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

Answer key

  1. notes to read offline
  2. the sound on/off setting
  3. Kites
  4. 6
  5. Aman
  6. 5
  7. False
  8. False
  9. in the cloud
  10. on the phone
  11. on the phone
  12. on the phone
  13. Monsoon
  14. use it on any device
  15. Zoya
  16. in the cloud
  17. 5
  18. a list
  19. in the cloud
  20. a named box for a value
  21. 4
  22. photos on two devices
  23. Kabir
  24. False
  25. Maths
  26. on the phone
  27. 3
  28. False
  29. Sunrise
  30. Meera
  31. Monsoon
  32. 4
  33. Maths
  34. 5
  35. 6
  36. False
  37. True
  38. Arjun
  39. 4
  40. Meera

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