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

Answer key

  1. in the cloud
  2. Science
  3. True
  4. a named box for a value
  5. 8
  6. a draft you are typing
  7. Monsoon
  8. 3
  9. in the cloud
  10. on the phone
  11. True
  12. Stars
  13. a shared to-do list
  14. in the cloud
  15. 5
  16. 6
  17. False
  18. the phone is lost
  19. True
  20. 5
  21. 7
  22. notes to read offline
  23. 3
  24. 5
  25. False
  26. a list
  27. on the phone
  28. True
  29. your last game level
  30. Riya
  31. 5
  32. 6
  33. 3
  34. data saved on the phone
  35. 2
  36. photos on two devices
  37. Rain
  38. False
  39. True
  40. use it on any device

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