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

Answer key

  1. False
  2. 3
  3. True
  4. 11
  5. a shared to-do list
  6. chat messages to friends
  7. in the cloud
  8. True
  9. on the phone
  10. True
  11. your last game level
  12. the sound on/off setting
  13. 4
  14. a named box for a value
  15. on the phone
  16. 4
  17. in the cloud
  18. Art
  19. 5
  20. use it on any device
  21. on the phone
  22. Maths
  23. Hindi
  24. 5
  25. True
  26. Meera
  27. Ocean
  28. True
  29. 4
  30. a list
  31. 5
  32. the phone is lost
  33. on the phone
  34. False
  35. 4
  36. 5
  37. True
  38. False
  39. Rain
  40. notes to read offline

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