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

Answer key

  1. 3
  2. a draft you are typing
  3. 5
  4. the sound on/off setting
  5. Rain
  6. True
  7. 3
  8. notes to read offline
  9. False
  10. Monsoon
  11. in the cloud
  12. 0
  13. 5
  14. use it on any device
  15. a list
  16. Meera
  17. 6
  18. False
  19. Music
  20. 6
  21. 4
  22. True
  23. in the cloud
  24. Sunrise
  25. Arjun
  26. in the cloud
  27. in the cloud
  28. 4
  29. Kabir
  30. Maths
  31. Maths
  32. your last game level
  33. a class leaderboard
  34. on the phone
  35. a named box for a value
  36. 5
  37. False
  38. Monsoon
  39. a shared to-do list
  40. Ocean

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