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

Answer key

  1. 3
  2. False
  3. data saved on the phone
  4. a named box for a value
  5. True
  6. in the cloud
  7. 4
  8. a list
  9. the sound on/off setting
  10. 5
  11. True
  12. 5
  13. True
  14. use it on any device
  15. 6
  16. a class leaderboard
  17. 3
  18. Science
  19. photos on two devices
  20. True
  21. False
  22. your last game level
  23. on the phone
  24. Kites
  25. 7
  26. a shared to-do list
  27. 5
  28. Arjun
  29. True
  30. Kites
  31. in the cloud
  32. 4
  33. in the cloud
  34. Ocean
  35. 4
  36. 3
  37. on the phone
  38. 7
  39. the phone is lost
  40. Stars

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