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

Answer key

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

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