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

Answer key

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

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