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

Answer key

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

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