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

Answer key

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

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