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

Answer key

  1. the sound on/off setting
  2. a shared to-do list
  3. on the phone
  4. a draft you are typing
  5. use it on any device
  6. 11
  7. Arjun
  8. 3
  9. on the phone
  10. your last game level
  11. False
  12. Monsoon
  13. Stars
  14. Sports
  15. 7
  16. a list
  17. Hindi
  18. Stars
  19. True
  20. 5
  21. 4
  22. Maths
  23. 6
  24. in the cloud
  25. 0
  26. 3
  27. in the cloud
  28. True
  29. the phone is lost
  30. Kites
  31. 7
  32. 3
  33. Sunrise
  34. False
  35. 4
  36. in the cloud
  37. 5
  38. Rain
  39. 9
  40. a class leaderboard

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