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

Answer key

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

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