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

Answer key

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

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