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

Answer key

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

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