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

Answer key

  1. a list
  2. Zoya
  3. True
  4. 2
  5. Sunrise
  6. Maths
  7. Maths
  8. False
  9. False
  10. Kites
  11. 5
  12. the sound on/off setting
  13. Music
  14. True
  15. False
  16. photos on two devices
  17. 3
  18. 3
  19. on the phone
  20. Sports
  21. Ocean
  22. 5
  23. 4
  24. 3
  25. a shared to-do list
  26. 5
  27. 3
  28. on the phone
  29. Art
  30. Ocean
  31. 5
  32. False
  33. notes to read offline
  34. a named box for a value
  35. 5
  36. True
  37. Hindi
  38. use it on any device
  39. data saved on the phone
  40. Meera

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