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

Answer key

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

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