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

Answer key

  1. a list
  2. True
  3. chat messages to friends
  4. 0
  5. 3
  6. data saved on the phone
  7. 4
  8. False
  9. False
  10. a named box for a value
  11. on the phone
  12. in the cloud
  13. 8
  14. use it on any device
  15. in the cloud
  16. Rain
  17. the phone is lost
  18. 9
  19. Maths
  20. 5
  21. in the cloud
  22. 3
  23. 9
  24. 4
  25. notes to read offline
  26. True
  27. Art
  28. the sound on/off setting
  29. 5
  30. 4
  31. 6
  32. 7
  33. Aman
  34. in the cloud
  35. 2
  36. Monsoon
  37. Maths
  38. True
  39. Sunrise
  40. 10

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