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

Answer key

  1. False
  2. photos on two devices
  3. 2
  4. on the phone
  5. chat messages to friends
  6. 5
  7. on the phone
  8. a draft you are typing
  9. Maths
  10. 4
  11. Art
  12. Science
  13. False
  14. 3
  15. Sunrise
  16. Monsoon
  17. False
  18. True
  19. Music
  20. 3
  21. in the cloud
  22. 6
  23. in the cloud
  24. data saved on the phone
  25. True
  26. 0
  27. in the cloud
  28. Stars
  29. Meera
  30. use it on any device
  31. True
  32. your last game level
  33. 3
  34. True
  35. 3
  36. Music
  37. Zoya
  38. 3
  39. notes to read offline
  40. a list

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