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

Answer key

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

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