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

Answer key

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

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