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

Answer key

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

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