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

Answer key

  1. False
  2. in the cloud
  3. a class leaderboard
  4. a draft you are typing
  5. on the phone
  6. on the phone
  7. the phone is lost
  8. False
  9. chat messages to friends
  10. 4
  11. True
  12. Riya
  13. Kites
  14. 6
  15. the sound on/off setting
  16. data saved on the phone
  17. 6
  18. Sports
  19. Zoya
  20. your last game level
  21. Zoya
  22. in the cloud
  23. in the cloud
  24. a shared to-do list
  25. False
  26. False
  27. 5
  28. Riya
  29. Hindi
  30. True
  31. False
  32. on the phone
  33. a list
  34. 6
  35. on the phone
  36. 12
  37. 3
  38. a named box for a value
  39. Sunrise
  40. 4

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