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

Answer key

  1. in the cloud
  2. True
  3. True
  4. use it on any device
  5. 5
  6. Sunrise
  7. 0
  8. Kabir
  9. False
  10. 9
  11. Music
  12. chat messages to friends
  13. photos on two devices
  14. 8
  15. data saved on the phone
  16. the phone is lost
  17. Hindi
  18. 6
  19. 2
  20. 8
  21. your last game level
  22. 4
  23. False
  24. a list
  25. Ocean
  26. True
  27. Meera
  28. in the cloud
  29. a named box for a value
  30. True
  31. a class leaderboard
  32. Aman
  33. in the cloud
  34. 6
  35. 7
  36. 2
  37. True
  38. 3
  39. Riya
  40. Aman

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