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

Answer key

  1. True
  2. in the cloud
  3. 7
  4. Ocean
  5. in the cloud
  6. Kabir
  7. True
  8. in the cloud
  9. Monsoon
  10. a list
  11. 6
  12. on the phone
  13. a named box for a value
  14. 0
  15. Science
  16. your last game level
  17. Meera
  18. 3
  19. True
  20. Hindi
  21. False
  22. Stars
  23. chat messages to friends
  24. Kabir
  25. False
  26. data saved on the phone
  27. in the cloud
  28. on the phone
  29. notes to read offline
  30. False
  31. 4
  32. 3
  33. the phone is lost
  34. use it on any device
  35. Aman
  36. 11
  37. Sunrise
  38. Hindi
  39. 5
  40. 3

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