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

Answer key

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

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