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

Answer key

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

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