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

Answer key

  1. on the phone
  2. the sound on/off setting
  3. photos on two devices
  4. True
  5. False
  6. 3
  7. on the phone
  8. a named box for a value
  9. 4
  10. Ocean
  11. False
  12. Maths
  13. in the cloud
  14. 4
  15. 3
  16. False
  17. on the phone
  18. 3
  19. 5
  20. 3
  21. False
  22. 4
  23. Art
  24. 4
  25. False
  26. 6
  27. True
  28. True
  29. in the cloud
  30. 5
  31. False
  32. 0
  33. 6
  34. 3
  35. the phone is lost
  36. 9
  37. False
  38. 3
  39. chat messages to friends
  40. 5

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