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

Answer key

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

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