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

Answer key

  1. Ocean
  2. 4
  3. on the phone
  4. 3
  5. data saved on the phone
  6. 0
  7. photos on two devices
  8. Ocean
  9. Kites
  10. False
  11. a class leaderboard
  12. in the cloud
  13. in the cloud
  14. notes to read offline
  15. Zoya
  16. False
  17. 8
  18. 4
  19. 3
  20. Art
  21. in the cloud
  22. 5
  23. 5
  24. 2
  25. on the phone
  26. 3
  27. the sound on/off setting
  28. on the phone
  29. your last game level
  30. a list
  31. Kites
  32. Kabir
  33. on the phone
  34. 10
  35. True
  36. Aman
  37. False
  38. 3
  39. False
  40. use it on any device

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