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

Answer key

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

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