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

Answer key

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

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