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

Answer key

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

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