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

Answer key

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

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