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

Answer key

  1. in the cloud
  2. 0
  3. Art
  4. 4
  5. 2
  6. False
  7. False
  8. on the phone
  9. Arjun
  10. Kites
  11. 6
  12. on the phone
  13. a named box for a value
  14. Zoya
  15. Stars
  16. notes to read offline
  17. Hindi
  18. a draft you are typing
  19. use it on any device
  20. True
  21. chat messages to friends
  22. data saved on the phone
  23. a class leaderboard
  24. in the cloud
  25. a list
  26. False
  27. 5
  28. 5
  29. 4
  30. 3
  31. Science
  32. the phone is lost
  33. Stars
  34. in the cloud
  35. Kabir
  36. False
  37. 13
  38. Riya
  39. Ocean
  40. True

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