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

Answer key

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

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