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

Answer key

  1. False
  2. False
  3. a shared to-do list
  4. 4
  5. 5
  6. a class leaderboard
  7. chat messages to friends
  8. Ocean
  9. on the phone
  10. use it on any device
  11. 10
  12. 3
  13. Zoya
  14. True
  15. False
  16. Art
  17. False
  18. your last game level
  19. in the cloud
  20. 3
  21. 5
  22. 4
  23. Meera
  24. Arjun
  25. Music
  26. 5
  27. in the cloud
  28. Riya
  29. notes to read offline
  30. a list
  31. Ocean
  32. Zoya
  33. False
  34. False
  35. True
  36. 3
  37. True
  38. Music
  39. True
  40. True

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