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

Answer key

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

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