← Data: variables, lists and saving lesson New set →

App Dev Worksheet: Variables, Lists and Saving

App development lesson 15: Data: variables, lists and saving · Set 900 · 40 questions
TalentJR

Developer's tip (Box, list, place): A variable holds one value; a list holds many in order. Positions start at 0. push adds to the end; pop takes off the last item; length is how many items. On the phone: works offline, private. In the cloud: shared, any device, needs the internet.

NameDateTime takenScore ___ / 40
  1. 1.💾 What number does this code show?
    let points = 9;
    points = points - 5;
    points = points + 2;
    show(points);
  2. 2.💾 Which can hold many values in order? (a) a switch (b) a single number (c) a button (d) a list
  3. 3.Which of these fits saving in the cloud? (a) a draft you are typing (b) the sound on/off setting (c) a shared to-do list (d) notes to read offline
  4. 4.Which of these fits saving on the phone? (a) photos on two devices (b) chat messages to friends (c) a class leaderboard (d) the sound on/off setting
  5. 5.💾 Which works with no internet at all? (a) data saved on the phone (b) a cloud leaderboard (c) a shared chat (d) a cloud backup
  6. 6.💾 Where should the app save notes to read offline: on the phone or in the cloud? (a) in the cloud (b) on the phone
  7. 7.True or false: your last game level fits saving in the cloud. (a) False (b) True
  8. 8.True or false: chat messages to friends fits saving on the phone. (a) False (b) True
  9. 9.💾 Where should the app save the sound on/off setting: on the phone or in the cloud? (a) in the cloud (b) on the phone
  10. 10.💾 What is a variable? (a) a named box for a value (b) a picture (c) a phone setting (d) a type of screen
  11. 11.💾 What number does this code show?
    let lives = 7;
    lives = lives - 2;
    lives = lives + 5;
    show(lives);
  12. 12.Which of these fits saving on the phone? (a) a shared to-do list (b) a class leaderboard (c) chat messages to friends (d) your last game level
  13. 13.Which of these fits saving on the phone? (a) chat messages to friends (b) photos on two devices (c) a class leaderboard (d) notes to read offline
  14. 14.💾 Saving data in the cloud lets you ___. (a) use it on any device (b) shrink the app (c) skip the internet (d) never need a password
  15. 15.💾 pop() takes off the last item. What does this code show?
    let notes = ["Maths", "Art", "Music", "Science"];
    notes.pop();
    show(notes[notes.length - 1]);
    (a) Science (b) Maths (c) Music (d) Art
  16. 16.True or false: a class leaderboard fits saving on the phone. (a) False (b) True
  17. 17.💾 pop() takes off the last item. What does this code show?
    let songs = ["Monsoon", "Ocean", "Sunrise"];
    songs.pop();
    show(songs[songs.length - 1]);
    (a) Monsoon (b) Ocean (c) Sunrise
  18. 18.💾 Where should the app save your last game level: on the phone or in the cloud? (a) in the cloud (b) on the phone
  19. 19.💾 What number does this code show?
    let friends = ["Arjun", "Aman"];
    friends.push("Meera");
    show(friends.length);
  20. 20.💾 In most code, the first item of a list is at position ___. (a) 0 (b) 10 (c) 1 (d) 2
  21. 21.True or false: notes to read offline fits saving on the phone. (a) False (b) True
  22. 22.💾 Where should the app save photos on two devices: on the phone or in the cloud? (a) on the phone (b) in the cloud
  23. 23.Which of these fits saving in the cloud? (a) the sound on/off setting (b) notes to read offline (c) photos on two devices (d) a draft you are typing
  24. 24.True or false: the sound on/off setting fits saving in the cloud. (a) False (b) True
  25. 25.💾 Where should the app save a draft you are typing: on the phone or in the cloud? (a) in the cloud (b) on the phone
  26. 26.💾 What does this code show? (Positions start at 0.)
    let friends = ["Aman", "Meera", "Arjun", "Zoya", "Riya"];
    show(friends[2]);
    (a) Zoya (b) Meera (c) Aman (d) Arjun
  27. 27.💾 What number does this code show?
    let notes = ["Maths", "Music", "Art"];
    notes.push("Sports");
    show(notes.length);
  28. 28.Which of these fits saving on the phone? (a) photos on two devices (b) a draft you are typing (c) a class leaderboard (d) chat messages to friends
  29. 29.True or false: a shared to-do list fits saving on the phone. (a) False (b) True
  30. 30.💾 What does this code show? (Positions start at 0.)
    let friends = ["Kabir", "Riya", "Zoya"];
    show(friends[0]);
    (a) Kabir (b) Riya (c) Zoya
  31. 31.True or false: photos on two devices fits saving in the cloud. (a) False (b) True
  32. 32.💾 pop() takes off the last item. What does this code show?
    let notes = ["Maths", "Sports", "Music", "Hindi", "Art"];
    notes.pop();
    show(notes[notes.length - 1]);
    (a) Sports (b) Music (c) Hindi (d) Maths
  33. 33.💾 What number does this code show?
    let coins = 4;
    coins = coins - 1;
    coins = coins + 3;
    show(coins);
  34. 34.True or false: chat messages to friends fits saving in the cloud. (a) False (b) True
  35. 35.True or false: a class leaderboard fits saving in the cloud. (a) False (b) True
  36. 36.💾 What number does this code show?
    let notes = ["Art", "Music", "Sports", "Maths"];
    notes.push("Science");
    notes.push("Hindi");
    show(notes.length);
  37. 37.Which of these fits saving in the cloud? (a) your last game level (b) chat messages to friends (c) the sound on/off setting (d) notes to read offline
  38. 38.💾 Where should the app save a shared to-do list: on the phone or in the cloud? (a) in the cloud (b) on the phone
  39. 39.💾 What number does this code show?
    let stars = 5;
    stars = stars - 3;
    stars = stars + 2;
    show(stars);
  40. 40.💾 What number does this code show?
    let stars = 7;
    stars = stars - 7;
    stars = stars + 2;
    show(stars);

Answer key

  1. 6
  2. a list
  3. a shared to-do list
  4. the sound on/off setting
  5. data saved on the phone
  6. on the phone
  7. False
  8. False
  9. on the phone
  10. a named box for a value
  11. 10
  12. your last game level
  13. notes to read offline
  14. use it on any device
  15. Music
  16. False
  17. Ocean
  18. on the phone
  19. 3
  20. 0
  21. True
  22. in the cloud
  23. photos on two devices
  24. False
  25. on the phone
  26. Arjun
  27. 4
  28. a draft you are typing
  29. False
  30. Kabir
  31. True
  32. Hindi
  33. 6
  34. True
  35. True
  36. 6
  37. chat messages to friends
  38. in the cloud
  39. 4
  40. 2

Free app development lessons, practice and worksheets at talentjr.in/app-development-for-students