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

Answer key

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

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