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

Answer key

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

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