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

Answer key

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

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