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

Answer key

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

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