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

Answer key

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

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