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

Answer key

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

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