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

Answer key

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

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