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

Answer key

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

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