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

Answer key

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

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