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

Answer key

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

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