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

Answer key

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

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