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

Answer key

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

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