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

Answer key

  1. on the phone
  2. in the cloud
  3. a list
  4. True
  5. False
  6. on the phone
  7. 4
  8. 6
  9. 9
  10. in the cloud
  11. Kabir
  12. a named box for a value
  13. on the phone
  14. the phone is lost
  15. use it on any device
  16. Ocean
  17. photos on two devices
  18. data saved on the phone
  19. in the cloud
  20. Ocean
  21. in the cloud
  22. 5
  23. 4
  24. a shared to-do list
  25. 3
  26. False
  27. Music
  28. Kabir
  29. 6
  30. 8
  31. True
  32. Sports
  33. notes to read offline
  34. Science
  35. 5
  36. Sports
  37. False
  38. 4
  39. on the phone
  40. 0

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