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

Answer key

  1. False
  2. False
  3. the phone is lost
  4. in the cloud
  5. False
  6. False
  7. 6
  8. Sports
  9. in the cloud
  10. True
  11. True
  12. use it on any device
  13. on the phone
  14. Sunrise
  15. Science
  16. Aman
  17. a class leaderboard
  18. 5
  19. Art
  20. Art
  21. a shared to-do list
  22. on the phone
  23. Zoya
  24. a draft you are typing
  25. chat messages to friends
  26. False
  27. False
  28. 0
  29. 6
  30. 4
  31. 4
  32. 4
  33. True
  34. Kabir
  35. 5
  36. 8
  37. a list
  38. Music
  39. Music
  40. on the phone

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