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

Answer key

  1. True
  2. data saved on the phone
  3. the phone is lost
  4. in the cloud
  5. a draft you are typing
  6. False
  7. the sound on/off setting
  8. 1
  9. Maths
  10. in the cloud
  11. False
  12. True
  13. False
  14. Ocean
  15. Sunrise
  16. in the cloud
  17. 10
  18. your last game level
  19. Riya
  20. Maths
  21. Kabir
  22. 4
  23. Meera
  24. a list
  25. in the cloud
  26. on the phone
  27. 6
  28. Aman
  29. 5
  30. Stars
  31. photos on two devices
  32. False
  33. False
  34. on the phone
  35. 6
  36. Monsoon
  37. on the phone
  38. chat messages to friends
  39. Hindi
  40. 6

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