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

Answer key

  1. in the cloud
  2. False
  3. Kites
  4. True
  5. Kites
  6. the sound on/off setting
  7. a shared to-do list
  8. 4
  9. Hindi
  10. in the cloud
  11. 3
  12. Rain
  13. Aman
  14. a named box for a value
  15. on the phone
  16. data saved on the phone
  17. on the phone
  18. your last game level
  19. chat messages to friends
  20. photos on two devices
  21. Sunrise
  22. Arjun
  23. 5
  24. 4
  25. Hindi
  26. 5
  27. False
  28. a list
  29. notes to read offline
  30. 3
  31. True
  32. Ocean
  33. Monsoon
  34. True
  35. Hindi
  36. Sports
  37. False
  38. the phone is lost
  39. use it on any device
  40. Arjun

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