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

Answer key

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

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