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

Answer key

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

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