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

Answer key

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

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