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

Answer key

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

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