Guest User

Untitled

a guest
Jun 22nd, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. "use strict";
  2.  
  3. let jobs = require('./jobs'); // load the jobs module
  4.  
  5. let jobList = jobs.readJobs(); // read the jobs.csv file
  6. console.log("Total # of Jobs " + jobList.length); // how many jobs did we load?
  7.  
  8. let managers = getManagerJobs(jobList); // how many manager jobs are there
  9. console.log("Count of Manager Jobs " + managers.length);
  10.  
  11. // TODO 2 - show the count of jobs that are for Manager
  12. // let myJobs = getCategoryJobs(jobsList , 'Manager');
  13. // TODO 2 - show the count of jobs that are for Director
  14. // TODO 2 - show the count of jobs that are for Other
  15. // TODO 2 - show the count of jobs that are for Vice Pres
  16.  
  17. // TODO 4 - how many jobs are there in Dallas
  18. // TODO 4 - how many jobs are there in Fort Worth
  19.  
  20. // TODO 5 - how many jobs are there in Dallas for Vice Pres
  21. // TODO 5 - how many jobs are there in Fort Worth for Director
  22.  
  23. // TODO 7 - what is the average salary for all jobs
  24. // TODO 7 - what is the average salary for Dallas jobs
  25. // TODO 7 - what is the average salary for Dallas Director jobs
  26.  
  27. // TODO 1 - DO THIS FIRST modify this function to return a list of jobs for any category
  28. // change the name of the function to not be category specific
  29. function getManagerJobs( jobs ) {
  30. let list = []; // empty array to hold jobs that match
  31. for (let job of jobs) { // look at all jobs in array
  32. if (job.category === 'Manager') { // is this a manager job?
  33. list.push(job); // yup, save it
  34. }
  35. }
  36. return list; // send back the jobs found
  37. }
  38.  
  39. // TODO 3 - create function to find jobs in a particular city
  40.  
  41.  
  42. // TODO 6 - Create a function to calculate the average salary from a list of jobs
Add Comment
Please, Sign In to add comment