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

Answer key

  1. in the cloud
  2. your last game level
  3. in the cloud
  4. the phone is lost
  5. True
  6. 4
  7. False
  8. in the cloud
  9. Science
  10. a named box for a value
  11. on the phone
  12. on the phone
  13. True
  14. notes to read offline
  15. False
  16. False
  17. 3
  18. data saved on the phone
  19. False
  20. Rain
  21. Ocean
  22. 6
  23. the sound on/off setting
  24. a class leaderboard
  25. chat messages to friends
  26. 3
  27. in the cloud
  28. a draft you are typing
  29. 2
  30. Sunrise
  31. 5
  32. a list
  33. False
  34. True
  35. 5
  36. Art
  37. 0
  38. 5
  39. Ocean
  40. 5

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