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

Answer key

  1. a class leaderboard
  2. in the cloud
  3. the sound on/off setting
  4. a named box for a value
  5. a list
  6. 5
  7. a draft you are typing
  8. use it on any device
  9. Sports
  10. 7
  11. 3
  12. the phone is lost
  13. Sunrise
  14. in the cloud
  15. chat messages to friends
  16. Meera
  17. True
  18. 4
  19. False
  20. 4
  21. 8
  22. 6
  23. a shared to-do list
  24. True
  25. False
  26. on the phone
  27. 5
  28. on the phone
  29. False
  30. Ocean
  31. data saved on the phone
  32. 6
  33. in the cloud
  34. photos on two devices
  35. Zoya
  36. 3
  37. True
  38. on the phone
  39. Monsoon
  40. in the cloud

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