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

Answer key

  1. on the phone
  2. in the cloud
  3. use it on any device
  4. Maths
  5. chat messages to friends
  6. on the phone
  7. 3
  8. in the cloud
  9. a shared to-do list
  10. notes to read offline
  11. False
  12. 5
  13. Rain
  14. False
  15. 4
  16. Riya
  17. 3
  18. 0
  19. 5
  20. a named box for a value
  21. in the cloud
  22. Hindi
  23. 4
  24. 5
  25. Ocean
  26. Meera
  27. the sound on/off setting
  28. True
  29. on the phone
  30. a draft you are typing
  31. on the phone
  32. 4
  33. 3
  34. data saved on the phone
  35. Rain
  36. Hindi
  37. 4
  38. False
  39. Science
  40. True

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