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

Answer key

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

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