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

Answer key

  1. False
  2. on the phone
  3. a draft you are typing
  4. data saved on the phone
  5. 7
  6. True
  7. Sunrise
  8. a class leaderboard
  9. the phone is lost
  10. the sound on/off setting
  11. on the phone
  12. on the phone
  13. in the cloud
  14. use it on any device
  15. a named box for a value
  16. Music
  17. 4
  18. Art
  19. 5
  20. Zoya
  21. Monsoon
  22. False
  23. Rain
  24. a list
  25. Music
  26. False
  27. 4
  28. 3
  29. 6
  30. True
  31. in the cloud
  32. True
  33. 3
  34. in the cloud
  35. Maths
  36. 9
  37. 6
  38. Kabir
  39. your last game level
  40. Aman

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