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

Answer key

  1. on the phone
  2. a draft you are typing
  3. on the phone
  4. data saved on the phone
  5. 4
  6. False
  7. the phone is lost
  8. chat messages to friends
  9. a named box for a value
  10. 4
  11. use it on any device
  12. 2
  13. the sound on/off setting
  14. Kabir
  15. True
  16. on the phone
  17. your last game level
  18. Riya
  19. False
  20. 2
  21. in the cloud
  22. on the phone
  23. 5
  24. True
  25. 8
  26. Science
  27. Maths
  28. 0
  29. 5
  30. notes to read offline
  31. 3
  32. in the cloud
  33. 4
  34. 5
  35. Science
  36. False
  37. True
  38. 5
  39. 3
  40. Stars

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