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

Answer key

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

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