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

Answer key

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

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