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

Answer key

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

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