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

Answer key

  1. your last game level
  2. False
  3. photos on two devices
  4. 12
  5. in the cloud
  6. a shared to-do list
  7. 6
  8. 5
  9. 6
  10. on the phone
  11. Rain
  12. Stars
  13. True
  14. 4
  15. Science
  16. Hindi
  17. 7
  18. on the phone
  19. 4
  20. use it on any device
  21. 3
  22. 4
  23. in the cloud
  24. Monsoon
  25. Science
  26. False
  27. Stars
  28. Stars
  29. a class leaderboard
  30. Music
  31. notes to read offline
  32. data saved on the phone
  33. Arjun
  34. the sound on/off setting
  35. 6
  36. 7
  37. on the phone
  38. 4
  39. Ocean
  40. False

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