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

Answer key

  1. False
  2. in the cloud
  3. False
  4. a list
  5. data saved on the phone
  6. in the cloud
  7. False
  8. 6
  9. True
  10. 5
  11. 6
  12. the phone is lost
  13. notes to read offline
  14. your last game level
  15. True
  16. on the phone
  17. 3
  18. 4
  19. True
  20. 3
  21. Kabir
  22. a class leaderboard
  23. on the phone
  24. 3
  25. 5
  26. in the cloud
  27. chat messages to friends
  28. 4
  29. False
  30. Kabir
  31. True
  32. False
  33. Kabir
  34. Meera
  35. 2
  36. Hindi
  37. 4
  38. 6
  39. Zoya
  40. Aman

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