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

Answer key

  1. 2
  2. 5
  3. 9
  4. the phone is lost
  5. a draft you are typing
  6. True
  7. Sunrise
  8. on the phone
  9. notes to read offline
  10. 2
  11. in the cloud
  12. data saved on the phone
  13. in the cloud
  14. a list
  15. Arjun
  16. 6
  17. use it on any device
  18. on the phone
  19. Sports
  20. Science
  21. False
  22. Art
  23. True
  24. 6
  25. 5
  26. 5
  27. False
  28. 4
  29. Meera
  30. in the cloud
  31. on the phone
  32. 5
  33. a class leaderboard
  34. True
  35. Zoya
  36. 6
  37. a named box for a value
  38. Ocean
  39. a shared to-do list
  40. Music

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