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

Answer key

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

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