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

Answer key

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

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