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

Answer key

  1. True
  2. on the phone
  3. data saved on the phone
  4. Maths
  5. photos on two devices
  6. False
  7. the phone is lost
  8. in the cloud
  9. Sports
  10. True
  11. a list
  12. 5
  13. use it on any device
  14. in the cloud
  15. True
  16. on the phone
  17. in the cloud
  18. your last game level
  19. Arjun
  20. Rain
  21. a draft you are typing
  22. True
  23. Art
  24. in the cloud
  25. 4
  26. 5
  27. Riya
  28. 5
  29. False
  30. a named box for a value
  31. 4
  32. 3
  33. chat messages to friends
  34. Sunrise
  35. a shared to-do list
  36. Kites
  37. Ocean
  38. 4
  39. 5
  40. False

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