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

Answer key

  1. Music
  2. Kabir
  3. your last game level
  4. a list
  5. the sound on/off setting
  6. on the phone
  7. a named box for a value
  8. 6
  9. True
  10. in the cloud
  11. True
  12. on the phone
  13. False
  14. on the phone
  15. a class leaderboard
  16. 4
  17. a draft you are typing
  18. True
  19. Hindi
  20. 5
  21. True
  22. False
  23. 5
  24. 4
  25. 7
  26. False
  27. 9
  28. 4
  29. chat messages to friends
  30. in the cloud
  31. on the phone
  32. Art
  33. photos on two devices
  34. Sunrise
  35. 6
  36. 4
  37. 0
  38. 5
  39. use it on any device
  40. Science

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