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

Answer key

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

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