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

Answer key

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

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