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

Answer key

  1. 6
  2. in the cloud
  3. False
  4. True
  5. photos on two devices
  6. Ocean
  7. Stars
  8. Science
  9. 5
  10. 3
  11. the sound on/off setting
  12. data saved on the phone
  13. 6
  14. False
  15. in the cloud
  16. in the cloud
  17. your last game level
  18. Rain
  19. 4
  20. 4
  21. True
  22. Hindi
  23. Maths
  24. 6
  25. 5
  26. True
  27. False
  28. Aman
  29. True
  30. False
  31. Maths
  32. 3
  33. 5
  34. use it on any device
  35. True
  36. chat messages to friends
  37. Rain
  38. Arjun
  39. Science
  40. Kabir

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