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

Answer key

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

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