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

Answer key

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

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