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

Answer key

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

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