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

Answer key

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

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