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

Answer key

  1. in the cloud
  2. True
  3. 7
  4. Music
  5. the sound on/off setting
  6. in the cloud
  7. True
  8. False
  9. True
  10. on the phone
  11. notes to read offline
  12. chat messages to friends
  13. 3
  14. Rain
  15. data saved on the phone
  16. Riya
  17. 2
  18. True
  19. your last game level
  20. Arjun
  21. 5
  22. Rain
  23. a draft you are typing
  24. True
  25. Meera
  26. Zoya
  27. False
  28. Art
  29. True
  30. Kabir
  31. 5
  32. 2
  33. 4
  34. 3
  35. photos on two devices
  36. the phone is lost
  37. on the phone
  38. Aman
  39. a named box for a value
  40. a shared to-do list

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