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

Answer key

  1. False
  2. in the cloud
  3. the phone is lost
  4. False
  5. notes to read offline
  6. False
  7. the sound on/off setting
  8. in the cloud
  9. a class leaderboard
  10. Maths
  11. 4
  12. 6
  13. Stars
  14. 4
  15. a list
  16. data saved on the phone
  17. 5
  18. a draft you are typing
  19. Arjun
  20. True
  21. 0
  22. Arjun
  23. 5
  24. Kites
  25. a named box for a value
  26. on the phone
  27. on the phone
  28. on the phone
  29. Music
  30. in the cloud
  31. 4
  32. 4
  33. Maths
  34. Art
  35. False
  36. True
  37. False
  38. True
  39. 4
  40. Sports

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