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

Answer key

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

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