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

Answer key

  1. 7
  2. 0
  3. Riya
  4. Riya
  5. in the cloud
  6. 9
  7. a named box for a value
  8. in the cloud
  9. photos on two devices
  10. 6
  11. 4
  12. Riya
  13. on the phone
  14. use it on any device
  15. in the cloud
  16. False
  17. True
  18. notes to read offline
  19. 6
  20. False
  21. 6
  22. Hindi
  23. False
  24. Kabir
  25. False
  26. Music
  27. False
  28. Aman
  29. Zoya
  30. 6
  31. the sound on/off setting
  32. Meera
  33. in the cloud
  34. 4
  35. True
  36. chat messages to friends
  37. 5
  38. on the phone
  39. Zoya
  40. Science

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