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

Answer key

  1. Aman
  2. in the cloud
  3. False
  4. Sunrise
  5. Arjun
  6. 1
  7. use it on any device
  8. Meera
  9. 3
  10. 8
  11. data saved on the phone
  12. a list
  13. a shared to-do list
  14. True
  15. True
  16. 3
  17. True
  18. Maths
  19. your last game level
  20. Music
  21. Monsoon
  22. a draft you are typing
  23. the sound on/off setting
  24. Ocean
  25. a named box for a value
  26. on the phone
  27. Riya
  28. 5
  29. Kites
  30. on the phone
  31. False
  32. Aman
  33. Sports
  34. Sunrise
  35. False
  36. Rain
  37. 0
  38. on the phone
  39. Music
  40. Aman

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