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

Answer key

  1. on the phone
  2. your last game level
  3. Kites
  4. on the phone
  5. Maths
  6. True
  7. 4
  8. a named box for a value
  9. 6
  10. chat messages to friends
  11. in the cloud
  12. 6
  13. 5
  14. Zoya
  15. 6
  16. 4
  17. Kites
  18. 4
  19. 5
  20. 3
  21. False
  22. notes to read offline
  23. 2
  24. Aman
  25. 4
  26. data saved on the phone
  27. 5
  28. 4
  29. Meera
  30. 4
  31. use it on any device
  32. True
  33. a class leaderboard
  34. 5
  35. Science
  36. True
  37. Rain
  38. Maths
  39. on the phone
  40. Ocean

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