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

Answer key

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

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