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

Answer key

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

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