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

Answer key

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

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