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

Answer key

  1. 6
  2. in the cloud
  3. False
  4. Music
  5. on the phone
  6. False
  7. True
  8. a named box for a value
  9. Stars
  10. False
  11. 6
  12. a draft you are typing
  13. Music
  14. notes to read offline
  15. Monsoon
  16. Music
  17. True
  18. False
  19. on the phone
  20. 6
  21. 6
  22. False
  23. 6
  24. the phone is lost
  25. Arjun
  26. 6
  27. in the cloud
  28. a shared to-do list
  29. Maths
  30. Hindi
  31. 4
  32. Science
  33. False
  34. True
  35. use it on any device
  36. 3
  37. Meera
  38. in the cloud
  39. 4
  40. Monsoon

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