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

Answer key

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

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