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

Answer key

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

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