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

Answer key

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

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