HW 5 Problem 1 (35 points): water bill calculation Fixed Cost: Residential - fixed cost Government...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
HW 5 Problem 1 (35 points): water bill calculation Fixed Cost: Residential - fixed cost Government - fixed cost Business - fixed cost User Residential Government Business Tax rate is 8.7% From the table above, Ex 1: residential, 450 cubic feet Water Usage (w) In cubic feet (cf) Ex 2: business, 1250 cubic feet For the first 400 cf, w 400 For the next 300 cf, 400 < w 700 For additional cf above 700 w > 700 $13.50 $ 3.75 $17.25 Cost per cubic foot total cost before tax = 17.25 +0.0553*1250 = 86.375 total cost after tax = (1+8.7/100)* 86.375=93.89 0.04 0.062 0.12 total cost before tax = 13.5+ (0.04*400) + 0.062*(450-400) = 32.6 total cost after tax = (1+8.7/100)* 32.6= 35.44 0.035 0.0553 Write a C program that read from the text file called "usage_data.txt" (on zyBooks, download it). for each line (consisting of a user type and water usage in cubic feet) in the given text file, find the total cost (including tax) and display the table of information (including the calculated cost) as shown in the sample code execution. Your C program must use the following user defined function: double water_billcalculation (char user_type, int water_use); //the function accepts user type and water usage in cubic feet and returns the cost with tax Note: To read one line from the text file, the statement below can be used. fscanf(your_file_pointername, "%c%d ",&var_youuseforUserType, &var_youusefor_cubicfeet); Observe that there is a space after %d - used to tell fscanf to ignore a newline character at the end of that line. 1 Sample code execution: Given part of "usage_data.txt (more test cases are given in the text file) r 120 g 5000 B 1250 M 50 R 450 G 1750 b 274 A 10 If your program works correctly, below is part of what your code should display Type Water usage Cost including tax($) r 120 19.89 g 5000 194.30 B 1250 93.89 M R G A Type is not found 450 1750 274 Type is not found 35.44 70.66 35.22 Note: The user type can now be either lowercase or UPPERcase. If the type is not Residential (R/r), Business (B/b) or Government (G/g), it should display "Type is not found". HW 5 Problem 1 (35 points): water bill calculation Fixed Cost: Residential - fixed cost Government - fixed cost Business - fixed cost User Residential Government Business Tax rate is 8.7% From the table above, Ex 1: residential, 450 cubic feet Water Usage (w) In cubic feet (cf) Ex 2: business, 1250 cubic feet For the first 400 cf, w 400 For the next 300 cf, 400 < w 700 For additional cf above 700 w > 700 $13.50 $ 3.75 $17.25 Cost per cubic foot total cost before tax = 17.25 +0.0553*1250 = 86.375 total cost after tax = (1+8.7/100)* 86.375=93.89 0.04 0.062 0.12 total cost before tax = 13.5+ (0.04*400) + 0.062*(450-400) = 32.6 total cost after tax = (1+8.7/100)* 32.6= 35.44 0.035 0.0553 Write a C program that read from the text file called "usage_data.txt" (on zyBooks, download it). for each line (consisting of a user type and water usage in cubic feet) in the given text file, find the total cost (including tax) and display the table of information (including the calculated cost) as shown in the sample code execution. Your C program must use the following user defined function: double water_billcalculation (char user_type, int water_use); //the function accepts user type and water usage in cubic feet and returns the cost with tax Note: To read one line from the text file, the statement below can be used. fscanf(your_file_pointername, "%c%d ",&var_youuseforUserType, &var_youusefor_cubicfeet); Observe that there is a space after %d - used to tell fscanf to ignore a newline character at the end of that line. 1 Sample code execution: Given part of "usage_data.txt (more test cases are given in the text file) r 120 g 5000 B 1250 M 50 R 450 G 1750 b 274 A 10 If your program works correctly, below is part of what your code should display Type Water usage Cost including tax($) r 120 19.89 g 5000 194.30 B 1250 93.89 M R G A Type is not found 450 1750 274 Type is not found 35.44 70.66 35.22 Note: The user type can now be either lowercase or UPPERcase. If the type is not Residential (R/r), Business (B/b) or Government (G/g), it should display "Type is not found".
Expert Answer:
Answer rating: 100% (QA)
C Program include stdio h include stdlib h Function prototype double waterbillcalcul... View the full answer
Related Book For
Taxation Of Individuals And Business Entities 2015
ISBN: 9780077862367
6th Edition
Authors: Brian Spilker, Benjamin Ayers, John Robinson, Edmund Outslay, Ronald Worsham, John Barrick, Connie Weaver
Posted Date:
Students also viewed these programming questions
-
Red, White and Blue are equal partners. White retires, his share of goodwill is ~ 18,000. The remaining partners have decided to continue the business sharing profits and losses in the ratio of 3 :...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-6. On December 12, Irene purchased the building where her store is located. She paid...
-
For show by the method described in this chapter that the following pairs of FAs are equivalent: FA +1 (1 (1 a. b FA a b
-
Explain why cities situated by the ocean tend to have less extreme temperatures than inland cities at the same latitude.
-
1 Find the compound amount and compound interest if $4000 is invested for eight years and interest is compounded continuously at the annual rate 6%. The compound amount will be $ (Round to the...
-
For each of the following situations, calculate the population standard error of the mean \(\sigma \mathrm{X}^{-}\). a. \(\sigma=8 ; N=16\) b. \(\sigma=12 ; N=64\) c. \(\sigma=2 ; N=25\) d....
-
A study dealing with health care issues plans to take a sample survey of 1500 Americans to estimate the proportion who have health insurance and the mean dollar amount that Americans spent on health...
-
What are the implications of incorporating machine learning algorithms, such as deep learning neural networks, in the identification and mitigation of operational risks within large-scale financial...
-
The Hickory Cabinet and Furniture Company produces sofas, tables, and chairs at its plant in Greensboro, North Carolina. The plant uses three main resources to make furniturewood, upholstery, and...
-
The below figure shows a rectangular prism ABCDEFGH, with lengths: CD = 8, DH = 5, and EH = 6. Triangles ABC and AFC form a dihedral angle. calculate the size of this dihedral angle. To the nearest...
-
You have inherited property in Vermont that would make an excellent ski resort. One of the slopes has a cliff on the other side of the hill, and this gives you a moneysaving idea. Instead of a chair...
-
A burglar evading the police is running as fast as he can on a building's flat rooftop. At the edge, he sees another flat rooftop across an alley. The horizontal distance across the alley is \(8.0...
-
You have to specify the power output of a motor for a ski tow rope that will carry 20 skiers at a time. The grade of the ski slope is \(32^{\circ}\) above horizontal, and the average coefficient of...
-
You are playing with a toy in which a marble launched by a spring rolls along a track full of loop-the-loops and curves with almost no energy dissipated. You want the marble to have a speed of \(0.70...
-
You throw a ball at an angle of \(30^{\circ}\) above the horizontal at a wall \(20 \mathrm{~m}\) away. The ball's initial speed is \(15 \mathrm{~m} / \mathrm{s}\), and it leaves your hand at a height...
-
Virgin Mobile offers a cell phone plan that charges 20 dollarsper month for up to 400 minutes of use, plus 15 cents for each textmessage. Assuming that a user does not exceed the monthly 400minutes...
-
H.J. Heinzs annual dividends were as follows: 1990 ..............$0.540 1991.............. 0.620 1992 .............. 0.700 1993.............. 0.780 1994 .............. 0.860 1995 .............. 0.940...
-
Scot and Vidia, married taxpayers, earn $240,000 in taxable income and $5,000 in interest from an investment in City of Tampa bonds. Using the U.S. tax rate schedule for married filing jointly, how...
-
How are life insurance proceeds taxed if a policy is cashed out early?
-
The IRS recently completed an audit of Shea's tax return and assessed $15,000 additional tax. Shea requested an appeals conference but was unable to settle the case at the conference. She is...
-
A container of an organic liquid a $25^{\circ} \mathrm{C}$ has a mass of $1100 \mathrm{~kg}$ and a volume of $0.94 \mathrm{~m}^{3}$. Find the liquid's weight, its density, and its specific gravity.
-
What is the pressure one mile $(1.6 \mathrm{~km})$ beneath the ocean's surface?
-
A vertical, cylindrical tank with a diameter of $10 \mathrm{~m}$ and a depth of $4 \mathrm{~m}$ is filled to the top with water at $25^{\circ} \mathrm{C}$. If the water is heated to $60^{\circ}...
Study smarter with the SolutionInn App