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

Answer key

  1. Maths
  2. the phone is lost
  3. data saved on the phone
  4. False
  5. False
  6. 4
  7. 3
  8. chat messages to friends
  9. True
  10. Aman
  11. Zoya
  12. on the phone
  13. photos on two devices
  14. Maths
  15. 4
  16. 5
  17. Kites
  18. 5
  19. a class leaderboard
  20. False
  21. 4
  22. False
  23. on the phone
  24. Monsoon
  25. 7
  26. in the cloud
  27. a draft you are typing
  28. 5
  29. True
  30. 6
  31. True
  32. in the cloud
  33. Music
  34. 0
  35. True
  36. the sound on/off setting
  37. in the cloud
  38. 4
  39. Science
  40. True

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