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

Answer key

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

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