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

Answer key

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

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