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

Answer key

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

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