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

Answer key

  1. Sunrise
  2. in the cloud
  3. False
  4. a list
  5. Stars
  6. Music
  7. 4
  8. True
  9. Kites
  10. use it on any device
  11. True
  12. Sunrise
  13. False
  14. 5
  15. 5
  16. Aman
  17. True
  18. Sports
  19. 7
  20. your last game level
  21. Arjun
  22. Hindi
  23. a named box for a value
  24. the phone is lost
  25. 3
  26. on the phone
  27. in the cloud
  28. 2
  29. Sunrise
  30. 0
  31. on the phone
  32. photos on two devices
  33. in the cloud
  34. Hindi
  35. on the phone
  36. data saved on the phone
  37. Hindi
  38. 5
  39. 4
  40. Stars

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