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

Answer key

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

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