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

Answer key

  1. Music
  2. 4
  3. a class leaderboard
  4. use it on any device
  5. in the cloud
  6. Art
  7. True
  8. 3
  9. Maths
  10. Kites
  11. 9
  12. Monsoon
  13. on the phone
  14. False
  15. on the phone
  16. Rain
  17. 3
  18. Music
  19. 4
  20. False
  21. a named box for a value
  22. 5
  23. chat messages to friends
  24. 6
  25. False
  26. True
  27. in the cloud
  28. the phone is lost
  29. 9
  30. a list
  31. in the cloud
  32. Hindi
  33. Ocean
  34. True
  35. notes to read offline
  36. True
  37. photos on two devices
  38. Science
  39. False
  40. Arjun

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