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

Answer key

  1. on the phone
  2. on the phone
  3. Sunrise
  4. a shared to-do list
  5. on the phone
  6. 3
  7. 2
  8. True
  9. a list
  10. 5
  11. 3
  12. False
  13. 12
  14. 10
  15. False
  16. a named box for a value
  17. 0
  18. True
  19. a class leaderboard
  20. the phone is lost
  21. False
  22. Aman
  23. data saved on the phone
  24. in the cloud
  25. 5
  26. in the cloud
  27. a draft you are typing
  28. Ocean
  29. 6
  30. in the cloud
  31. 4
  32. Hindi
  33. Aman
  34. use it on any device
  35. 7
  36. False
  37. True
  38. True
  39. 3
  40. Aman

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