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

Answer key

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

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