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

Answer key

  1. 0
  2. a shared to-do list
  3. use it on any device
  4. in the cloud
  5. on the phone
  6. in the cloud
  7. chat messages to friends
  8. the sound on/off setting
  9. Kabir
  10. Kabir
  11. Music
  12. Riya
  13. 5
  14. photos on two devices
  15. Art
  16. a named box for a value
  17. True
  18. True
  19. Sports
  20. True
  21. Riya
  22. True
  23. Zoya
  24. a list
  25. False
  26. 3
  27. data saved on the phone
  28. Zoya
  29. 5
  30. on the phone
  31. False
  32. in the cloud
  33. Rain
  34. True
  35. 7
  36. Rain
  37. 5
  38. Music
  39. False
  40. Stars

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