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

Answer key

  1. notes to read offline
  2. 4
  3. in the cloud
  4. False
  5. 7
  6. 0
  7. photos on two devices
  8. 6
  9. 7
  10. a list
  11. Science
  12. Kabir
  13. Art
  14. on the phone
  15. True
  16. in the cloud
  17. data saved on the phone
  18. 3
  19. chat messages to friends
  20. False
  21. Kabir
  22. 3
  23. Sports
  24. the sound on/off setting
  25. 7
  26. on the phone
  27. 6
  28. 3
  29. False
  30. Art
  31. Arjun
  32. use it on any device
  33. a shared to-do list
  34. 4
  35. 5
  36. 4
  37. 5
  38. the phone is lost
  39. False
  40. Kites

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