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

Answer key

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

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