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

Answer key

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

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