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

Answer key

  1. a class leaderboard
  2. 4
  3. on the phone
  4. notes to read offline
  5. Maths
  6. 0
  7. data saved on the phone
  8. your last game level
  9. the sound on/off setting
  10. Hindi
  11. Science
  12. a list
  13. True
  14. in the cloud
  15. Art
  16. a named box for a value
  17. Monsoon
  18. in the cloud
  19. chat messages to friends
  20. 5
  21. False
  22. 4
  23. True
  24. on the phone
  25. Stars
  26. 4
  27. Ocean
  28. use it on any device
  29. 6
  30. False
  31. False
  32. 1
  33. Sports
  34. Riya
  35. Rain
  36. Sunrise
  37. 5
  38. True
  39. the phone is lost
  40. 4

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