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

Answer key

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

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