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

Answer key

  1. in the cloud
  2. 2
  3. 7
  4. the phone is lost
  5. in the cloud
  6. a draft you are typing
  7. 4
  8. True
  9. 4
  10. 3
  11. chat messages to friends
  12. 6
  13. 5
  14. Ocean
  15. notes to read offline
  16. False
  17. True
  18. Science
  19. 5
  20. data saved on the phone
  21. a shared to-do list
  22. in the cloud
  23. True
  24. 3
  25. Kabir
  26. True
  27. 4
  28. True
  29. Monsoon
  30. use it on any device
  31. a list
  32. 10
  33. in the cloud
  34. on the phone
  35. 6
  36. Zoya
  37. False
  38. 2
  39. Monsoon
  40. Rain

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