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

Answer key

  1. 3
  2. False
  3. 4
  4. 5
  5. True
  6. Science
  7. in the cloud
  8. the sound on/off setting
  9. on the phone
  10. Sports
  11. 4
  12. False
  13. a list
  14. notes to read offline
  15. on the phone
  16. 0
  17. 5
  18. a shared to-do list
  19. True
  20. use it on any device
  21. Arjun
  22. 5
  23. 5
  24. Sunrise
  25. True
  26. True
  27. False
  28. photos on two devices
  29. on the phone
  30. on the phone
  31. in the cloud
  32. 4
  33. 1
  34. a draft you are typing
  35. 4
  36. a class leaderboard
  37. Sports
  38. the phone is lost
  39. 11
  40. Kabir

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