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

Answer key

  1. False
  2. 6
  3. on the phone
  4. 0
  5. a draft you are typing
  6. 4
  7. chat messages to friends
  8. a list
  9. on the phone
  10. True
  11. in the cloud
  12. False
  13. 4
  14. Maths
  15. Stars
  16. Zoya
  17. Rain
  18. Art
  19. 3
  20. in the cloud
  21. Aman
  22. 2
  23. Zoya
  24. 4
  25. Art
  26. the sound on/off setting
  27. a class leaderboard
  28. False
  29. 4
  30. True
  31. the phone is lost
  32. Sunrise
  33. your last game level
  34. Maths
  35. Zoya
  36. on the phone
  37. 5
  38. 7
  39. 7
  40. in the cloud

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