Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
maartjas.incomplemte
  • Loading branch information
EliaYazdi committed Aug 1, 2019
commit 20f4bbbb5f502f7f84c38597c405c6e28d148d89
29 changes: 18 additions & 11 deletions Week2/homework/maartjes-work.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,28 @@ const tuesday = [{
},
];

const maartjesTasks = monday.concat(tuesday);
const tasks = monday.concat(tuesday);
const maartjesHourlyRate = 20;

// eslint-disable-next-line no-unused-vars
const earnings = computeEarnings(maartjesTasks, maartjesHourlyRate)


function computeEarnings(tasks, hourlyRate) {
const taskHours = tasks.map(hours => tasks.duration / 60).filter(hours => hours <= 2);
const euroRates = taskHours.map(hours => hours * maartjesHourlyRate);




// eslint-disable-next-line no-unused-vars
const earnings = computeEarnings(maartjesTasks, maartjesHourlyRate);

// add code to convert `earnings` to a string rounded to two decimals (euro cents)
// add code to convert `earnings` to a string rounded to two decimals (euro cents)

console.log(`Maartje has earned €${'replace this string with the earnings rounded to euro cents'}`);
console.log(`Maartje has earned €${'replace this string with the earnings rounded to euro cents'}`);

// Do not change or remove anything below this line
module.exports = {
maartjesTasks,
maartjesHourlyRate,
computeEarnings,
};
// Do not change or remove anything below this line
module.exports = {
maartjesTasks,
maartjesHourlyRate,
computeEarnings,
};