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

Answer key

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

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