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

Answer key

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

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