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

Answer key

  1. Zoya
  2. 0
  3. data saved on the phone
  4. in the cloud
  5. in the cloud
  6. a list
  7. Kites
  8. 3
  9. the sound on/off setting
  10. False
  11. 3
  12. on the phone
  13. 5
  14. 3
  15. on the phone
  16. 3
  17. False
  18. Science
  19. True
  20. Riya
  21. 10
  22. a class leaderboard
  23. chat messages to friends
  24. a draft you are typing
  25. True
  26. 5
  27. 9
  28. Hindi
  29. a named box for a value
  30. True
  31. in the cloud
  32. 6
  33. a shared to-do list
  34. False
  35. 4
  36. photos on two devices
  37. Maths
  38. on the phone
  39. your last game level
  40. Kabir

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