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

Answer key

  1. a shared to-do list
  2. on the phone
  3. True
  4. 5
  5. 5
  6. 6
  7. 4
  8. Rain
  9. Ocean
  10. photos on two devices
  11. Arjun
  12. Hindi
  13. 3
  14. Hindi
  15. 6
  16. True
  17. False
  18. Science
  19. your last game level
  20. False
  21. 4
  22. 4
  23. on the phone
  24. 4
  25. Ocean
  26. 5
  27. Kabir
  28. chat messages to friends
  29. 4
  30. a named box for a value
  31. in the cloud
  32. False
  33. 5
  34. 2
  35. 5
  36. Kabir
  37. data saved on the phone
  38. 5
  39. Ocean
  40. False

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