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

Answer key

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

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