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

Answer key

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

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