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

Answer key

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

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