fdescamps / dojo-discount-campaign

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#The Discount Campaign

##Problem

The owner of a skateboard shop asks you for help: In order to attract more students and pupils to come to her store, she is about to launch a discount campaign. The idea is to offer a rebate for the period of one month. Since she has a pretty much complete set of customer data, she wants to get an overview over the average revenue within the target group, so that she can calculate a proper discount.

##The conditions for participation for customers are defined as follows: The job status of the customer must be one of student, pupil or apprentice The age must be 25 or less (the owner does not want to support long term students!) For the data analysis, all purchases of the calendar year (in this case: 2015) within the target group must be taken into consideration. The shop owner is interested in… the revenue aggregated by months (from January 2015 until December 2015) the total revenue throughout the entire year 2015

##Technical constraints Only lodash

The conditions for participation for customers are defined as follows: The job status of the customer must be one of student, pupil or apprentice The age must be 25 or lower

For the data analysis, all purchases of the calendar year (in this case: 2015) within the target group must be taken into consideration. The shop owner is interested in… the revenue aggregated by months (from January 2015 until December 2015) the total revenue throughout the entire year 2015

Expected output (we don't care of the "syntax")

Revenue for students in 2015 : Jan: 1155.36 €

Feb: 476.43 €

Mar: 1773.00 €

Apr: 1415.22 €

May: 1208.16 €

Jun: 1454.00 €

Jul: 1607.12 €

Aug: 1317.84 €

Sep: 976.02 €

Oct: 767.35 €

Nov: 1228.07 €

Dec: 1582.14 €

∑ 14960.71 €

About


Languages

Language:JavaScript 100.0%