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

Answer key

  1. in the cloud
  2. Music
  3. a shared to-do list
  4. Maths
  5. 4
  6. True
  7. use it on any device
  8. True
  9. 4
  10. the sound on/off setting
  11. 5
  12. in the cloud
  13. the phone is lost
  14. on the phone
  15. a list
  16. Aman
  17. Art
  18. chat messages to friends
  19. on the phone
  20. data saved on the phone
  21. Science
  22. notes to read offline
  23. 6
  24. photos on two devices
  25. 8
  26. Rain
  27. Riya
  28. on the phone
  29. True
  30. Kites
  31. True
  32. False
  33. 5
  34. Rain
  35. Zoya
  36. 6
  37. Art
  38. Ocean
  39. Art
  40. in the cloud

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