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

Answer key

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

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