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

Answer key

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

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