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

Answer key

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

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