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

Answer key

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

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