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

Answer key

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

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