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

Answer key

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

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