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

Answer key

  1. chat messages to friends
  2. Science
  3. True
  4. False
  5. a named box for a value
  6. Music
  7. data saved on the phone
  8. False
  9. False
  10. 4
  11. on the phone
  12. in the cloud
  13. Kabir
  14. 6
  15. Monsoon
  16. True
  17. 1
  18. 3
  19. Kabir
  20. 5
  21. use it on any device
  22. on the phone
  23. a draft you are typing
  24. 8
  25. Science
  26. Sports
  27. 6
  28. 4
  29. 3
  30. a shared to-do list
  31. the phone is lost
  32. False
  33. your last game level
  34. True
  35. 4
  36. Rain
  37. 6
  38. Hindi
  39. Stars
  40. a class leaderboard

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