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

Answer key

  1. the phone is lost
  2. False
  3. a named box for a value
  4. a shared to-do list
  5. notes to read offline
  6. Stars
  7. on the phone
  8. Meera
  9. your last game level
  10. on the phone
  11. a class leaderboard
  12. chat messages to friends
  13. Art
  14. 8
  15. on the phone
  16. Rain
  17. use it on any device
  18. data saved on the phone
  19. Science
  20. 4
  21. True
  22. in the cloud
  23. False
  24. a list
  25. Aman
  26. 3
  27. a draft you are typing
  28. in the cloud
  29. False
  30. False
  31. False
  32. 3
  33. True
  34. 4
  35. 5
  36. 6
  37. 3
  38. 5
  39. Sports
  40. on the phone

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