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

Answer key

  1. a named box for a value
  2. use it on any device
  3. on the phone
  4. data saved on the phone
  5. False
  6. Meera
  7. Science
  8. a class leaderboard
  9. 4
  10. 0
  11. True
  12. False
  13. True
  14. on the phone
  15. photos on two devices
  16. 11
  17. 5
  18. Sunrise
  19. Music
  20. Meera
  21. Meera
  22. 6
  23. a draft you are typing
  24. the sound on/off setting
  25. False
  26. True
  27. True
  28. your last game level
  29. Sunrise
  30. on the phone
  31. Kites
  32. on the phone
  33. 4
  34. in the cloud
  35. False
  36. in the cloud
  37. 6
  38. 3
  39. 3
  40. 4

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