Samples of the last homework assignment
//////////////////////////////////////////////////////////////////////
// Function: calculateCosts
// Calculates customer's costs based on the data input
// by the user
//
// Inputs: a float representing square yards purchased (value)
// a float representing cost per square yard (value)
// a float representing labor per square yard (value)
// a float representing floor preparation cost (value)
// a float representing discount rate (value)
//
// Outputs: a float representing carpet cost (reference)
// a float representing labor cost (reference)
// a float representing total discount (reference)
// a float representing total tax (reference)
// a float representing total customer charge (reference)
void calculateCosts(int sqr_yrds,
float cost_per_sqr_yrd,
float lbr_per_sqr_yrd,
float prep_cost,
float discount_rate,
float &carpet_cost,
float &labor_cost,
float &discount,
float &total_tax,
float &customer_charge);
// Function Name: calculateCosts
// Objective: Calculates costs associated with purchase
// of carpeting
//
// Inputs: an integer representing cost per square yard,
// a float representing cost per square yard,
// a float representing labor per square yard,
// a float representing prep charge, and
// a float representing discount percentage
// a constant float representing tax percentage
//
// Outputs: a float representing discount amount in dollars
// a float representing carpet charge
// a float representing tax amount in dollars
// a float representing labor charge
// a float representing total charge for the customer
void calculateCosts (int square_yards, float cost_per_sq_yd,
float labor_per_sq_yd, float prep_cost,
float discount, float &dscount,
float &carpet_charge, float &tax,
float &labor_charge, float &charge);
Next page
Previous page
Go to Lesson 7 index.