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

Answer key

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

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