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

Answer key

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

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