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

Answer key

  1. Riya
  2. a draft you are typing
  3. Stars
  4. on the phone
  5. False
  6. True
  7. in the cloud
  8. use it on any device
  9. 5
  10. 5
  11. a list
  12. on the phone
  13. in the cloud
  14. 6
  15. 5
  16. Sunrise
  17. on the phone
  18. 5
  19. True
  20. True
  21. 4
  22. Hindi
  23. the sound on/off setting
  24. True
  25. 11
  26. a shared to-do list
  27. Kites
  28. Art
  29. 6
  30. Zoya
  31. 3
  32. Stars
  33. data saved on the phone
  34. in the cloud
  35. 5
  36. Ocean
  37. False
  38. 6
  39. in the cloud
  40. your last game level

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