Question
You are working for the Passaic County Community Carpet Center. Your boss has asked you to write and execute a program that will generate customers
You are working for the Passaic County Community Carpet Center. Your boss has asked you to write and execute a program that will generate customers bills. Input consists of the following:
The Customer name (a string containing a blank)
The Customers id number (an integer) The Length and the Width of a room in feet and inches (Integers) The carpet price per square foot (float) The percentage of discount for each customer (float)
The labor cost is fixed at $1.65 / Sq foot, the tax rate is 6.825% and they are defined as constants.
Your programs design should use the function main () and the sub-functions noted below:
a. setdata( ) a function that allows you to input the data from the keyboard (all variables are passed by reference so they may return their values to the calling function). The function itself returns the area of a carpet needed in square feet to cover the room. Note that every fraction of a square foot is a square foot.
b. calculations( ) this is a function that calls the following three functions. Calculate the installed price calcinstalled( ) = cost of carpet + cost of labor Calculate the subtotal calcsubtotal ( ) = installed price - discount Calculate the total price calctotal( ) = the subtotal + taxes There may be intermediate calculations. It might also be possible to reuse a function, if it accomplishes the same task with different arguments
. c. showresult( ) is a function that calls three sub-functions headings( ) the name of the company, customers name, borders etc. measurements( ) a subroutine to print the length, width and area. Charges( ) prints the charges.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started