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

Answer key

  1. in the cloud
  2. 5
  3. Rain
  4. 5
  5. a class leaderboard
  6. data saved on the phone
  7. on the phone
  8. False
  9. False
  10. in the cloud
  11. Sunrise
  12. True
  13. False
  14. True
  15. Kites
  16. a named box for a value
  17. Arjun
  18. 5
  19. Aman
  20. Kabir
  21. Meera
  22. your last game level
  23. the phone is lost
  24. 0
  25. a list
  26. in the cloud
  27. False
  28. a shared to-do list
  29. 7
  30. 5
  31. Riya
  32. 4
  33. 3
  34. in the cloud
  35. True
  36. 4
  37. 5
  38. False
  39. Zoya
  40. 5

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