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

Answer key

  1. True
  2. Science
  3. Stars
  4. 4
  5. on the phone
  6. Zoya
  7. on the phone
  8. 1
  9. a draft you are typing
  10. 10
  11. data saved on the phone
  12. use it on any device
  13. on the phone
  14. Zoya
  15. a class leaderboard
  16. in the cloud
  17. Music
  18. 4
  19. Arjun
  20. False
  21. in the cloud
  22. 4
  23. False
  24. Monsoon
  25. 4
  26. 8
  27. 0
  28. 5
  29. Ocean
  30. False
  31. Arjun
  32. notes to read offline
  33. a shared to-do list
  34. Rain
  35. Kites
  36. Stars
  37. 8
  38. False
  39. Kites
  40. the phone is lost

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