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

Answer key

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

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