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

Answer key

  1. Riya
  2. 4
  3. Music
  4. False
  5. True
  6. Riya
  7. a list
  8. use it on any device
  9. notes to read offline
  10. a draft you are typing
  11. 7
  12. Ocean
  13. the phone is lost
  14. photos on two devices
  15. Hindi
  16. 4
  17. data saved on the phone
  18. on the phone
  19. False
  20. in the cloud
  21. chat messages to friends
  22. 2
  23. 4
  24. True
  25. False
  26. 3
  27. on the phone
  28. Music
  29. in the cloud
  30. 9
  31. a named box for a value
  32. in the cloud
  33. the sound on/off setting
  34. False
  35. Monsoon
  36. Kites
  37. 3
  38. Maths
  39. True
  40. Kabir

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