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

Answer key

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

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