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

Answer key

  1. True
  2. a list
  3. Maths
  4. False
  5. Rain
  6. Hindi
  7. 5
  8. chat messages to friends
  9. your last game level
  10. a class leaderboard
  11. Aman
  12. 4
  13. 4
  14. on the phone
  15. in the cloud
  16. Zoya
  17. 11
  18. notes to read offline
  19. use it on any device
  20. Sunrise
  21. 5
  22. data saved on the phone
  23. True
  24. Zoya
  25. on the phone
  26. Sports
  27. Science
  28. Aman
  29. on the phone
  30. 4
  31. on the phone
  32. False
  33. Zoya
  34. in the cloud
  35. Hindi
  36. 6
  37. in the cloud
  38. 3
  39. a shared to-do list
  40. a draft you are typing

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