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

Answer key

  1. on the phone
  2. a named box for a value
  3. False
  4. a class leaderboard
  5. False
  6. the sound on/off setting
  7. data saved on the phone
  8. the phone is lost
  9. 4
  10. 10
  11. on the phone
  12. True
  13. Hindi
  14. 3
  15. Monsoon
  16. False
  17. Rain
  18. Stars
  19. 5
  20. use it on any device
  21. Monsoon
  22. Kabir
  23. in the cloud
  24. True
  25. 4
  26. Hindi
  27. 7
  28. True
  29. 1
  30. a list
  31. on the phone
  32. Sunrise
  33. on the phone
  34. False
  35. True
  36. 3
  37. in the cloud
  38. a shared to-do list
  39. Sports
  40. Ocean

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