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

Answer key

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

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