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

Answer key

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

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