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

Answer key

  1. a class leaderboard
  2. 5
  3. True
  4. False
  5. on the phone
  6. a list
  7. in the cloud
  8. 0
  9. chat messages to friends
  10. on the phone
  11. Monsoon
  12. True
  13. use it on any device
  14. False
  15. 4
  16. 6
  17. 3
  18. True
  19. on the phone
  20. Hindi
  21. photos on two devices
  22. 6
  23. in the cloud
  24. False
  25. 3
  26. 11
  27. Kites
  28. 5
  29. Riya
  30. 9
  31. 4
  32. True
  33. a shared to-do list
  34. Zoya
  35. Sports
  36. False
  37. Zoya
  38. True
  39. 7
  40. the sound on/off setting

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