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

Answer key

  1. Sports
  2. Aman
  3. False
  4. Sunrise
  5. on the phone
  6. 6
  7. False
  8. Monsoon
  9. Rain
  10. 5
  11. 5
  12. Kabir
  13. use it on any device
  14. False
  15. in the cloud
  16. 2
  17. Aman
  18. notes to read offline
  19. data saved on the phone
  20. in the cloud
  21. a shared to-do list
  22. 5
  23. Hindi
  24. on the phone
  25. True
  26. the phone is lost
  27. False
  28. 6
  29. True
  30. Sunrise
  31. 8
  32. Art
  33. 5
  34. 6
  35. 8
  36. Hindi
  37. in the cloud
  38. a list
  39. Maths
  40. Ocean

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