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

Answer key

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

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