Below is a program that is supposed to print a customer statement after generating a 5 digit customer no , includes different functions to calculate carpet cost and labor costs .
These functions should be defined outside of the main() function. CalculateCarpetSize()
CalculateCarpetCost()
labourCost()
printCustomerStatement()
5) Learn and be consistent in using an indentation style to make your code easier to read.
My personal suggestion: Allman style. http://en.wikipedia.org/wiki/Indent_style
Does your code actually compile? And if yes, what compiler/IDE are you using? For example:
1 2 3 4 5 6 7 8 9 10 11 12 13
bool qualifyForDiscount(customerNo);
if (customerNo first number == 0)
qualifyForDiscount == true ;
// call function computeDiscount
computeDiscount (carpetCost);
{
srand(time(0));
discount = 00001 + rand () % 32767;
}
else
discount = 0.0;
return discount;