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

Answer key

  1. on the phone
  2. True
  3. a draft you are typing
  4. on the phone
  5. the phone is lost
  6. False
  7. 5
  8. 6
  9. Sports
  10. 3
  11. 6
  12. True
  13. in the cloud
  14. 3
  15. 1
  16. Rain
  17. Music
  18. Rain
  19. on the phone
  20. 5
  21. 3
  22. False
  23. data saved on the phone
  24. Sports
  25. photos on two devices
  26. in the cloud
  27. False
  28. your last game level
  29. False
  30. True
  31. Art
  32. Rain
  33. 5
  34. False
  35. True
  36. True
  37. 4
  38. Maths
  39. 5
  40. True

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