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

Answer key

  1. 3
  2. the sound on/off setting
  3. Kites
  4. Maths
  5. use it on any device
  6. a draft you are typing
  7. Ocean
  8. notes to read offline
  9. True
  10. a shared to-do list
  11. 0
  12. Hindi
  13. in the cloud
  14. in the cloud
  15. in the cloud
  16. True
  17. Stars
  18. a list
  19. data saved on the phone
  20. on the phone
  21. Zoya
  22. Sports
  23. a class leaderboard
  24. 4
  25. Science
  26. 6
  27. Art
  28. a named box for a value
  29. False
  30. on the phone
  31. 7
  32. 5
  33. Maths
  34. Science
  35. 4
  36. False
  37. True
  38. 9
  39. Maths
  40. on the phone

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