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

Answer key

  1. a named box for a value
  2. use it on any device
  3. True
  4. Aman
  5. data saved on the phone
  6. 0
  7. on the phone
  8. 5
  9. 6
  10. 4
  11. False
  12. 5
  13. notes to read offline
  14. in the cloud
  15. photos on two devices
  16. the phone is lost
  17. 3
  18. Zoya
  19. False
  20. 8
  21. True
  22. False
  23. on the phone
  24. on the phone
  25. 8
  26. 2
  27. a list
  28. 4
  29. 7
  30. in the cloud
  31. Kabir
  32. 4
  33. chat messages to friends
  34. Meera
  35. the sound on/off setting
  36. in the cloud
  37. Aman
  38. 8
  39. 6
  40. in the cloud

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