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

Answer key

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

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