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

Answer key

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

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