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

Answer key

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

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