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

Answer key

  1. 6
  2. Meera
  3. Ocean
  4. Arjun
  5. on the phone
  6. False
  7. use it on any device
  8. notes to read offline
  9. data saved on the phone
  10. True
  11. the sound on/off setting
  12. False
  13. 4
  14. 5
  15. True
  16. False
  17. 5
  18. False
  19. on the phone
  20. a list
  21. Zoya
  22. a named box for a value
  23. a draft you are typing
  24. Maths
  25. Science
  26. 6
  27. chat messages to friends
  28. Maths
  29. 4
  30. True
  31. Sunrise
  32. on the phone
  33. False
  34. True
  35. Science
  36. False
  37. a class leaderboard
  38. True
  39. 5
  40. Arjun

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