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

Answer key

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

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