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

Answer key

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

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