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

Answer key

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

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