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

Answer key

  1. False
  2. your last game level
  3. in the cloud
  4. on the phone
  5. Stars
  6. a named box for a value
  7. Kabir
  8. Aman
  9. use it on any device
  10. False
  11. 5
  12. False
  13. in the cloud
  14. True
  15. the phone is lost
  16. True
  17. notes to read offline
  18. Hindi
  19. chat messages to friends
  20. 3
  21. Art
  22. 12
  23. a shared to-do list
  24. 5
  25. on the phone
  26. False
  27. in the cloud
  28. Aman
  29. 2
  30. in the cloud
  31. 5
  32. a class leaderboard
  33. 5
  34. a list
  35. Rain
  36. Hindi
  37. 4
  38. the sound on/off setting
  39. Hindi
  40. 4

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