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

Answer key

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

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