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

Answer key

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

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