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

Answer key

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

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