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

Answer key

  1. False
  2. a shared to-do list
  3. False
  4. Hindi
  5. Riya
  6. in the cloud
  7. 5
  8. in the cloud
  9. Stars
  10. 5
  11. in the cloud
  12. on the phone
  13. Kabir
  14. 8
  15. notes to read offline
  16. Science
  17. Riya
  18. Sports
  19. use it on any device
  20. Riya
  21. Stars
  22. 4
  23. 4
  24. 3
  25. 5
  26. in the cloud
  27. 4
  28. the phone is lost
  29. Arjun
  30. Rain
  31. 3
  32. 8
  33. True
  34. Hindi
  35. 3
  36. 9
  37. 6
  38. 4
  39. 6
  40. a class leaderboard

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