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

Answer key

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

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