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

Answer key

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

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