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

Answer key

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

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