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

Answer key

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

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