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

Answer key

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

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