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

Answer key

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

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