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

Answer key

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

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