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

Answer key

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

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