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

Answer key

  1. 0
  2. in the cloud
  3. Art
  4. True
  5. a draft you are typing
  6. notes to read offline
  7. your last game level
  8. 4
  9. on the phone
  10. True
  11. False
  12. Kites
  13. 6
  14. 6
  15. use it on any device
  16. data saved on the phone
  17. Riya
  18. 5
  19. Riya
  20. a class leaderboard
  21. 4
  22. Zoya
  23. 3
  24. Kites
  25. 3
  26. 4
  27. Art
  28. Rain
  29. the sound on/off setting
  30. Sunrise
  31. Ocean
  32. in the cloud
  33. 4
  34. Kabir
  35. False
  36. on the phone
  37. Science
  38. Ocean
  39. Aman
  40. Maths

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