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

Answer key

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

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