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

Answer key

  1. a list
  2. True
  3. Rain
  4. 5
  5. data saved on the phone
  6. use it on any device
  7. on the phone
  8. Arjun
  9. in the cloud
  10. Music
  11. on the phone
  12. a draft you are typing
  13. False
  14. Kites
  15. Art
  16. 3
  17. 5
  18. 4
  19. 0
  20. 4
  21. False
  22. Aman
  23. in the cloud
  24. 4
  25. 6
  26. Rain
  27. the sound on/off setting
  28. True
  29. Science
  30. a shared to-do list
  31. Ocean
  32. Aman
  33. Science
  34. 7
  35. 8
  36. 5
  37. a class leaderboard
  38. on the phone
  39. Meera
  40. notes to read offline

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