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

Answer key

  1. 6
  2. 4
  3. a shared to-do list
  4. 4
  5. False
  6. in the cloud
  7. Hindi
  8. True
  9. a class leaderboard
  10. Riya
  11. on the phone
  12. on the phone
  13. a list
  14. 5
  15. Science
  16. 3
  17. 5
  18. 0
  19. on the phone
  20. photos on two devices
  21. 5
  22. 6
  23. a named box for a value
  24. in the cloud
  25. Science
  26. 3
  27. Science
  28. chat messages to friends
  29. Sports
  30. Kabir
  31. 3
  32. False
  33. 5
  34. notes to read offline
  35. the phone is lost
  36. 3
  37. Music
  38. Art
  39. use it on any device
  40. in the cloud

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