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

Answer key

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

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