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

Answer key

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

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