1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

guys i need help :)

Discussion in 'Meet and Greet' started by PLM, Oct 1, 2011.

  1. PLM

    PLM New Member

    Sep 26, 2011
    Likes Received:
    Trophy Points:
    Write a C program that creates customers’ bills for a carpet company when the following information is given:
    A. The length and the width of the carpet in feet
    B. The carpet price per square foot
    C. The percent of discount for each customer
    The Labor cost is fixed at $0.35 per square foot. It is to be defined as constant. The tax rate is 8.5% applied after the discount. It is also to be defined as a constant. The input data consist of a set of three integers representing the length and width of the room to be carpeted, the percentage of the discount the owner gives to a customer, and a real number representing the unit price of the carpet. The program is to prompt the user for this input as shown below. (Colored numbers are typical responses.)
    Length of room (feet)? 30
    Width of room (feet)? 18
    Customer discount (percentage)? 9
    Cost per square foot (xxx.xx)? 8.32
    The Output is shown below. Be careful to align the decimal points.

    Length XXX ft
    Width XXX ft
    Area XXX square ft
    ------------------- ------------------ -------------
    Carpet XXX.XX $XXXX.XX
    Labor 0.35 XXXX.XX
    Discount XX% XXXX.XX
    Tax XXXX.XX

    The program’s design should use main and at least the six functions described below:
    a. Read data from the keyboard. This function is to use addresses to read all data and place them in the calling function’s variables.

    b. Calculate values. This function calls three subfunctions. Each function is to use addresses to store their results.
    • Calculate the installed price. This function calculates area, carpet cost, labor cost, and installed price. The installed price is the cost of the carpet and the cost of the labor.
    • Calculate the subtotal. This function calculates the discount and subtotal.
    • Calculate the total price with the discount and tax. This function calculates the tax and the total price.
    c. Print the result. Use two subfunctions to print the results: one to print the results: one to print the measurements, and one to print the charges.
    Test your program with the test data shown in table 4-3.

    Test Length Width Discount Cost
    1 23 13 12 $14.20
    2 35 8 0 $8.00
    3 14 11 10 $22.35

    thanks in advance for your help :D

Share This Page