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

Answer key

  1. in the cloud
  2. False
  3. True
  4. chat messages to friends
  5. Monsoon
  6. a draft you are typing
  7. 4
  8. a shared to-do list
  9. 4
  10. on the phone
  11. Music
  12. a class leaderboard
  13. True
  14. notes to read offline
  15. a list
  16. False
  17. a named box for a value
  18. False
  19. False
  20. 8
  21. 5
  22. Maths
  23. Kites
  24. data saved on the phone
  25. the sound on/off setting
  26. on the phone
  27. Arjun
  28. Kites
  29. 5
  30. False
  31. your last game level
  32. False
  33. on the phone
  34. Maths
  35. in the cloud
  36. 2
  37. 5
  38. 6
  39. 3
  40. 4

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