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

Answer key

  1. Rain
  2. the sound on/off setting
  3. Sports
  4. in the cloud
  5. data saved on the phone
  6. on the phone
  7. a shared to-do list
  8. a named box for a value
  9. True
  10. Stars
  11. a list
  12. False
  13. Sunrise
  14. on the phone
  15. use it on any device
  16. 6
  17. True
  18. a draft you are typing
  19. True
  20. Monsoon
  21. False
  22. Kabir
  23. Aman
  24. 6
  25. 12
  26. 5
  27. photos on two devices
  28. on the phone
  29. on the phone
  30. 10
  31. 6
  32. your last game level
  33. False
  34. Aman
  35. notes to read offline
  36. Maths
  37. 1
  38. True
  39. 12
  40. 0

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