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

Answer key

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

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