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

Answer key

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

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