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

Answer key

  1. 6
  2. True
  3. in the cloud
  4. chat messages to friends
  5. in the cloud
  6. True
  7. on the phone
  8. 5
  9. on the phone
  10. 5
  11. a draft you are typing
  12. the phone is lost
  13. on the phone
  14. False
  15. False
  16. data saved on the phone
  17. 4
  18. in the cloud
  19. on the phone
  20. 5
  21. a list
  22. a class leaderboard
  23. 4
  24. 3
  25. 4
  26. Kabir
  27. Hindi
  28. notes to read offline
  29. the sound on/off setting
  30. 3
  31. Kites
  32. Maths
  33. Sunrise
  34. False
  35. a shared to-do list
  36. Sunrise
  37. Meera
  38. 7
  39. Music
  40. True

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