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

Answer key

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

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