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

Answer key

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

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