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

Answer key

  1. a list
  2. Zoya
  3. your last game level
  4. photos on two devices
  5. in the cloud
  6. a named box for a value
  7. 0
  8. False
  9. 2
  10. 4
  11. Sports
  12. True
  13. 4
  14. False
  15. False
  16. Zoya
  17. Music
  18. False
  19. Arjun
  20. 3
  21. the phone is lost
  22. Maths
  23. Stars
  24. a class leaderboard
  25. False
  26. on the phone
  27. use it on any device
  28. chat messages to friends
  29. 2
  30. Zoya
  31. Sports
  32. data saved on the phone
  33. a shared to-do list
  34. False
  35. in the cloud
  36. Sunrise
  37. 3
  38. Sports
  39. Music
  40. 2

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