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

Answer key

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

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