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

Answer key

  1. False
  2. on the phone
  3. 6
  4. in the cloud
  5. True
  6. 5
  7. your last game level
  8. on the phone
  9. Riya
  10. False
  11. False
  12. True
  13. in the cloud
  14. True
  15. on the phone
  16. a shared to-do list
  17. 5
  18. 3
  19. in the cloud
  20. 11
  21. photos on two devices
  22. Sunrise
  23. Art
  24. 5
  25. Art
  26. the sound on/off setting
  27. 0
  28. Maths
  29. 6
  30. a list
  31. Ocean
  32. Art
  33. True
  34. a draft you are typing
  35. Hindi
  36. Kites
  37. 9
  38. Science
  39. 3
  40. chat messages to friends

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