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

Answer key

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

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