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

Answer key

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

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