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

Answer key

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

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