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

Answer key

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

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