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

Answer key

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

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