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

Answer key

  1. photos on two devices
  2. Maths
  3. on the phone
  4. Zoya
  5. 3
  6. on the phone
  7. a shared to-do list
  8. data saved on the phone
  9. 4
  10. the phone is lost
  11. True
  12. the sound on/off setting
  13. Stars
  14. 4
  15. Kabir
  16. Rain
  17. 5
  18. 4
  19. Rain
  20. 5
  21. Stars
  22. 6
  23. notes to read offline
  24. 3
  25. a named box for a value
  26. 4
  27. False
  28. in the cloud
  29. on the phone
  30. 1
  31. 4
  32. 7
  33. a list
  34. Zoya
  35. Art
  36. chat messages to friends
  37. False
  38. 2
  39. False
  40. Sunrise

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