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

Answer key

  1. the phone is lost
  2. on the phone
  3. Arjun
  4. in the cloud
  5. Art
  6. False
  7. your last game level
  8. 7
  9. Science
  10. on the phone
  11. 3
  12. 5
  13. 7
  14. 5
  15. Maths
  16. False
  17. False
  18. 4
  19. Aman
  20. on the phone
  21. a named box for a value
  22. a list
  23. 7
  24. the sound on/off setting
  25. a shared to-do list
  26. a class leaderboard
  27. True
  28. False
  29. True
  30. Science
  31. 4
  32. 4
  33. True
  34. False
  35. 5
  36. a draft you are typing
  37. on the phone
  38. in the cloud
  39. in the cloud
  40. photos on two devices

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