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

Answer key

  1. Art
  2. 4
  3. on the phone
  4. 6
  5. Kabir
  6. False
  7. Monsoon
  8. on the phone
  9. a shared to-do list
  10. your last game level
  11. 7
  12. photos on two devices
  13. in the cloud
  14. notes to read offline
  15. True
  16. Aman
  17. data saved on the phone
  18. on the phone
  19. 5
  20. Maths
  21. 6
  22. 5
  23. 6
  24. a named box for a value
  25. True
  26. use it on any device
  27. the phone is lost
  28. a class leaderboard
  29. in the cloud
  30. False
  31. False
  32. 2
  33. 5
  34. in the cloud
  35. on the phone
  36. Sports
  37. 4
  38. a list
  39. a draft you are typing
  40. False

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