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

Answer key

  1. in the cloud
  2. use it on any device
  3. Sunrise
  4. data saved on the phone
  5. False
  6. a class leaderboard
  7. True
  8. Music
  9. on the phone
  10. on the phone
  11. chat messages to friends
  12. False
  13. photos on two devices
  14. False
  15. True
  16. False
  17. in the cloud
  18. 4
  19. Aman
  20. 6
  21. 3
  22. 4
  23. 4
  24. your last game level
  25. a list
  26. a draft you are typing
  27. Science
  28. notes to read offline
  29. Kites
  30. Rain
  31. Maths
  32. in the cloud
  33. 4
  34. 0
  35. 6
  36. False
  37. 4
  38. a shared to-do list
  39. True
  40. in the cloud

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