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

Answer key

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

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