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

Answer key

  1. a named box for a value
  2. data saved on the phone
  3. False
  4. chat messages to friends
  5. True
  6. on the phone
  7. Stars
  8. 0
  9. Maths
  10. Riya
  11. Art
  12. 2
  13. False
  14. 10
  15. 7
  16. use it on any device
  17. notes to read offline
  18. 7
  19. a list
  20. Kabir
  21. a class leaderboard
  22. in the cloud
  23. Kites
  24. False
  25. 4
  26. False
  27. Art
  28. a draft you are typing
  29. 4
  30. True
  31. Maths
  32. on the phone
  33. False
  34. True
  35. on the phone
  36. 3
  37. in the cloud
  38. 11
  39. a shared to-do list
  40. Rain

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