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

Answer key

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

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