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

Answer key

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

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