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

Answer key

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

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