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

Answer key

  1. chat messages to friends
  2. 9
  3. in the cloud
  4. on the phone
  5. Meera
  6. notes to read offline
  7. False
  8. a named box for a value
  9. 6
  10. the phone is lost
  11. on the phone
  12. 0
  13. a class leaderboard
  14. data saved on the phone
  15. in the cloud
  16. 6
  17. Riya
  18. True
  19. Rain
  20. Ocean
  21. True
  22. 6
  23. the sound on/off setting
  24. True
  25. Ocean
  26. Meera
  27. False
  28. 4
  29. 6
  30. True
  31. True
  32. False
  33. False
  34. False
  35. False
  36. Maths
  37. your last game level
  38. on the phone
  39. a draft you are typing
  40. 7

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