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

Answer key

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

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