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

Answer key

  1. True
  2. True
  3. Maths
  4. 5
  5. Art
  6. on the phone
  7. 5
  8. the sound on/off setting
  9. 5
  10. in the cloud
  11. 5
  12. Zoya
  13. notes to read offline
  14. a draft you are typing
  15. a shared to-do list
  16. a named box for a value
  17. 3
  18. False
  19. on the phone
  20. Science
  21. a class leaderboard
  22. photos on two devices
  23. Rain
  24. the phone is lost
  25. on the phone
  26. Art
  27. 5
  28. 2
  29. your last game level
  30. on the phone
  31. 6
  32. Monsoon
  33. 7
  34. 6
  35. False
  36. False
  37. chat messages to friends
  38. Arjun
  39. True
  40. True

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