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

Answer key

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

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