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

Answer key

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

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