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

Answer key

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

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