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

Answer key

  1. a class leaderboard
  2. in the cloud
  3. Aman
  4. False
  5. a draft you are typing
  6. 4
  7. in the cloud
  8. True
  9. a shared to-do list
  10. Music
  11. Sports
  12. Ocean
  13. 3
  14. Hindi
  15. use it on any device
  16. Zoya
  17. your last game level
  18. True
  19. on the phone
  20. True
  21. Aman
  22. 5
  23. 6
  24. in the cloud
  25. the phone is lost
  26. 3
  27. Meera
  28. False
  29. a named box for a value
  30. on the phone
  31. Art
  32. 8
  33. in the cloud
  34. Aman
  35. a list
  36. 5
  37. on the phone
  38. 7
  39. Science
  40. on the phone

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