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

Answer key

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

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