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

Answer key

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

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