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

Answer key

  1. a named box for a value
  2. photos on two devices
  3. False
  4. the phone is lost
  5. True
  6. Hindi
  7. Maths
  8. on the phone
  9. in the cloud
  10. Music
  11. 5
  12. Art
  13. use it on any device
  14. data saved on the phone
  15. 4
  16. on the phone
  17. 4
  18. False
  19. a list
  20. Sports
  21. in the cloud
  22. in the cloud
  23. Kabir
  24. True
  25. 3
  26. Science
  27. False
  28. on the phone
  29. 3
  30. your last game level
  31. Kites
  32. a draft you are typing
  33. 4
  34. False
  35. Zoya
  36. a shared to-do list
  37. Rain
  38. the sound on/off setting
  39. True
  40. 8

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