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

Answer key

  1. chat messages to friends
  2. Riya
  3. False
  4. in the cloud
  5. a named box for a value
  6. a draft you are typing
  7. 5
  8. photos on two devices
  9. notes to read offline
  10. a list
  11. Sunrise
  12. False
  13. on the phone
  14. in the cloud
  15. in the cloud
  16. Stars
  17. False
  18. True
  19. 6
  20. Arjun
  21. Riya
  22. 4
  23. 4
  24. on the phone
  25. True
  26. False
  27. Kites
  28. Maths
  29. 6
  30. data saved on the phone
  31. True
  32. Aman
  33. 3
  34. 5
  35. True
  36. 9
  37. Music
  38. use it on any device
  39. in the cloud
  40. Kites

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