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

Answer key

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

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