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

Answer key

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

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