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

Answer key

  1. 5
  2. chat messages to friends
  3. the sound on/off setting
  4. use it on any device
  5. Kites
  6. a class leaderboard
  7. Science
  8. notes to read offline
  9. True
  10. True
  11. in the cloud
  12. False
  13. in the cloud
  14. False
  15. on the phone
  16. on the phone
  17. the phone is lost
  18. Riya
  19. Hindi
  20. data saved on the phone
  21. in the cloud
  22. True
  23. 4
  24. Zoya
  25. 9
  26. Sports
  27. False
  28. on the phone
  29. 6
  30. Stars
  31. Arjun
  32. your last game level
  33. Art
  34. Riya
  35. Sports
  36. 6
  37. Science
  38. Rain
  39. False
  40. 0

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