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

Answer key

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

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