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
-
A CDMA receiver gets the following chips: (-1 +1 -3 +1 -1 -3 +1 +1). Assuming the chip sequences defined in Fig. 2-45(b), which stations transmitted, and which bits did each one send?
-
Let S be the set of bit strings defined recursively by S and 0x S, x1 S if x S, where is the empty string. a) Find all strings in S of length not exceeding five. b) Give an explicit description...
-
The laminate described in Problem 7.15 has laminae that are \(0.25 \mathrm{~mm}\) thick and the stiffness matrix associated with the \(0^{\circ}\) lamina is given by If a single bending moment per...
-
1. The number of issued shares is shown in the first column of the statement of stockholders equity. Had Lowes issued more or fewer shares of common stock than The Home Depot at the end of Fiscal...
-
QUESTIONS: (1) This question is about the market for peanut butter and asks about the per-unit tax . (a) Sketch a graph of the market for peanut butter , labeling the supply and demand curves, both...
-
A farmer notices an algae bloom in the pond next to a large crop field. This farmer knows that algae blooms are generally caused by increased nitrogen in the water. What should this farmer check to...
-
2. Provide a mechanism for the following transformation. Make sure to account for the formation of this particular diastereomer by paying careful attention to relative stereochemical relationships in...
-
In a mid-year acquisition, how much of the investee's revenues, expenses, and dividends should be included in consolidated totals? A. The portion accrued after the date of acquisition. B. Only the...
-
The red wine sauce recipe contains which three liquids? Question 46 options: Red wine - veal demi glaze - chicken stock Port wine - veal demi glaze - beef stock Red wine - chicken demi glaze - beef...
-
Use the power property of logarithms to make equivalent statements. log7(16) = log7(2)
-
In 2006, the Texas legislature required businesses to pay a franchise tax, which is calculated based on the business's profit margins. What type of tax is this? Service tax Regressive tax Progressive...
-
What must loan servicers do within 30 days of the end of the escrow account computation year? A. Conduct an escrow account analysis and send an Annual Escrow Account Statement to borrowers B. Send an...
-
Sierra Company has two operating departments: Mixing and Bottling. Mixing occupies 25,245 square feet. Bottling occupies 20,655 square feet. Maintenance costs of $248,000 are allocated to operating...
-
How has the globalization of firms affected the diversity of their employees? Why has increased diversity put an additional burden on accounting systems?
-
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...
-
Mr. Smith wants to buy a car and is deciding between brands A and B. Car A costs \(\$ 20,000\), and Mr. Smith estimates that at the rate he drives he will sell it after 2 years and buy another of the...
-
Consider a continuous-time environment, with \(e\) as a variable outside of the market. (a) Suppose the final payoff is \(V\left(x_{e}, T ight)=x_{e}(T)\). Find \(V\left(x_{e}, t ight)\). (b) Find a...
-
Mr. Jones was considering a new grapefruit venture that would generate a random sequence of yearly cash flows. He asked his son. Gavin, "People tell me I should use a cost of capital figure to...
Study smarter with the SolutionInn App