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

Answer key

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

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