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

Answer key

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

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