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

Answer key

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

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