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

Answer key

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

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