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

Answer key

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

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