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

Answer key

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

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