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

Answer key

  1. 6
  2. Kites
  3. in the cloud
  4. True
  5. False
  6. Aman
  7. a draft you are typing
  8. 3
  9. on the phone
  10. Rain
  11. notes to read offline
  12. Zoya
  13. on the phone
  14. a shared to-do list
  15. a list
  16. 0
  17. False
  18. True
  19. Zoya
  20. use it on any device
  21. 5
  22. 5
  23. a named box for a value
  24. False
  25. Monsoon
  26. True
  27. in the cloud
  28. True
  29. True
  30. Kites
  31. 5
  32. 1
  33. Kabir
  34. chat messages to friends
  35. 2
  36. Monsoon
  37. False
  38. on the phone
  39. photos on two devices
  40. Music

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