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

Answer key

  1. False
  2. True
  3. a draft you are typing
  4. False
  5. True
  6. in the cloud
  7. 4
  8. on the phone
  9. True
  10. Kabir
  11. False
  12. 3
  13. on the phone
  14. Ocean
  15. Kabir
  16. Monsoon
  17. False
  18. data saved on the phone
  19. 4
  20. on the phone
  21. Sports
  22. a list
  23. chat messages to friends
  24. 4
  25. 5
  26. Music
  27. 4
  28. False
  29. Sports
  30. use it on any device
  31. Aman
  32. a named box for a value
  33. 5
  34. Stars
  35. in the cloud
  36. 4
  37. Ocean
  38. 6
  39. notes to read offline
  40. False

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