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

Answer key

  1. on the phone
  2. True
  3. in the cloud
  4. False
  5. photos on two devices
  6. a list
  7. a draft you are typing
  8. 9
  9. 3
  10. notes to read offline
  11. Sunrise
  12. Zoya
  13. in the cloud
  14. True
  15. 3
  16. 5
  17. Science
  18. data saved on the phone
  19. in the cloud
  20. the sound on/off setting
  21. Meera
  22. 0
  23. 3
  24. Kabir
  25. 3
  26. False
  27. 5
  28. True
  29. Zoya
  30. 4
  31. a class leaderboard
  32. 5
  33. Music
  34. on the phone
  35. Riya
  36. a shared to-do list
  37. Rain
  38. 4
  39. Rain
  40. Riya

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