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

Answer key

  1. 7
  2. 3
  3. 1
  4. the phone is lost
  5. a named box for a value
  6. in the cloud
  7. Meera
  8. in the cloud
  9. on the phone
  10. on the phone
  11. 10
  12. notes to read offline
  13. True
  14. in the cloud
  15. on the phone
  16. data saved on the phone
  17. the sound on/off setting
  18. 4
  19. on the phone
  20. a draft you are typing
  21. 4
  22. False
  23. False
  24. 5
  25. in the cloud
  26. 3
  27. False
  28. Monsoon
  29. 6
  30. True
  31. 7
  32. a list
  33. True
  34. 4
  35. 5
  36. use it on any device
  37. Zoya
  38. Stars
  39. False
  40. 0

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