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

Answer key

  1. on the phone
  2. 8
  3. False
  4. a draft you are typing
  5. 7
  6. chat messages to friends
  7. 5
  8. a list
  9. 4
  10. on the phone
  11. 4
  12. Riya
  13. on the phone
  14. your last game level
  15. photos on two devices
  16. in the cloud
  17. False
  18. 6
  19. 3
  20. True
  21. data saved on the phone
  22. True
  23. True
  24. 5
  25. False
  26. in the cloud
  27. 4
  28. on the phone
  29. Ocean
  30. Stars
  31. 5
  32. 6
  33. a named box for a value
  34. 3
  35. False
  36. 6
  37. 5
  38. Science
  39. False
  40. Ocean

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