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

Answer key

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

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