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

Answer key

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

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