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

Answer key

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

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