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

Answer key

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

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