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

Answer key

  1. True
  2. the sound on/off setting
  3. Zoya
  4. the phone is lost
  5. in the cloud
  6. 0
  7. 5
  8. a draft you are typing
  9. 4
  10. 3
  11. False
  12. use it on any device
  13. a list
  14. False
  15. Rain
  16. notes to read offline
  17. photos on two devices
  18. 6
  19. on the phone
  20. Meera
  21. data saved on the phone
  22. 5
  23. 5
  24. your last game level
  25. False
  26. on the phone
  27. in the cloud
  28. a shared to-do list
  29. False
  30. 9
  31. 3
  32. a named box for a value
  33. 4
  34. True
  35. chat messages to friends
  36. 3
  37. in the cloud
  38. Zoya
  39. Arjun
  40. on the phone

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