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

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