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

Answer key

  1. on the phone
  2. 0
  3. True
  4. Sunrise
  5. on the phone
  6. Stars
  7. 4
  8. in the cloud
  9. in the cloud
  10. 4
  11. a shared to-do list
  12. Music
  13. True
  14. data saved on the phone
  15. False
  16. the sound on/off setting
  17. 5
  18. a named box for a value
  19. True
  20. a class leaderboard
  21. Ocean
  22. True
  23. Science
  24. on the phone
  25. 9
  26. chat messages to friends
  27. False
  28. 3
  29. a list
  30. 3
  31. Zoya
  32. 3
  33. notes to read offline
  34. in the cloud
  35. use it on any device
  36. the phone is lost
  37. Arjun
  38. your last game level
  39. Arjun
  40. Monsoon

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