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

Answer key

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

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