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

Answer key

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

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