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

Answer key

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

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