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

Answer key

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

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