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

Answer key

  1. on the phone
  2. a draft you are typing
  3. 9
  4. your last game level
  5. Stars
  6. a list
  7. Zoya
  8. True
  9. Science
  10. 3
  11. in the cloud
  12. 3
  13. the phone is lost
  14. 4
  15. True
  16. Kabir
  17. use it on any device
  18. on the phone
  19. chat messages to friends
  20. Stars
  21. True
  22. 0
  23. photos on two devices
  24. in the cloud
  25. Art
  26. Music
  27. Music
  28. a named box for a value
  29. the sound on/off setting
  30. Stars
  31. on the phone
  32. notes to read offline
  33. False
  34. Music
  35. a class leaderboard
  36. on the phone
  37. 6
  38. 4
  39. Art
  40. Kabir

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