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

Answer key

  1. False
  2. False
  3. Stars
  4. a list
  5. Aman
  6. 4
  7. Hindi
  8. Arjun
  9. a class leaderboard
  10. 4
  11. 3
  12. Riya
  13. False
  14. Kabir
  15. Riya
  16. 3
  17. Maths
  18. True
  19. notes to read offline
  20. Monsoon
  21. False
  22. Kites
  23. 5
  24. on the phone
  25. on the phone
  26. a named box for a value
  27. 8
  28. 10
  29. Stars
  30. 4
  31. True
  32. Kabir
  33. Sunrise
  34. 13
  35. Rain
  36. 3
  37. Sunrise
  38. 3
  39. a shared to-do list
  40. Ocean

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