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

Answer key

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

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