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

Answer key

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

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