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

Answer key

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

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