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

Answer key

  1. on the phone
  2. False
  3. True
  4. on the phone
  5. your last game level
  6. a named box for a value
  7. on the phone
  8. Art
  9. a class leaderboard
  10. Kites
  11. Art
  12. False
  13. data saved on the phone
  14. False
  15. notes to read offline
  16. 0
  17. a draft you are typing
  18. in the cloud
  19. use it on any device
  20. Maths
  21. 4
  22. Meera
  23. 2
  24. False
  25. 11
  26. 7
  27. Zoya
  28. Maths
  29. Rain
  30. Aman
  31. False
  32. True
  33. Aman
  34. True
  35. in the cloud
  36. Sports
  37. chat messages to friends
  38. 3
  39. True
  40. a shared to-do list

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