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

Answer key

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

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