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

Answer key

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

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