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

Answer key

  1. 6
  2. Music
  3. Rain
  4. 4
  5. 4
  6. False
  7. 6
  8. a list
  9. True
  10. 6
  11. 0
  12. in the cloud
  13. 2
  14. Rain
  15. on the phone
  16. Art
  17. on the phone
  18. the sound on/off setting
  19. Stars
  20. a named box for a value
  21. notes to read offline
  22. 7
  23. in the cloud
  24. in the cloud
  25. 8
  26. False
  27. photos on two devices
  28. False
  29. on the phone
  30. Stars
  31. False
  32. a class leaderboard
  33. Riya
  34. True
  35. 5
  36. 4
  37. the phone is lost
  38. in the cloud
  39. 4
  40. True

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