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

Answer key

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

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