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

Answer key

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

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