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

Answer key

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

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