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

Answer key

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

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