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

Answer key

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

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