Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Make a comprehensive C program (Including all required functions) with the aim of calculating the cost of power for a specific apartment building in each

image text in transcribed
image text in transcribed
Make a comprehensive C program (Including all required functions) with the aim of calculating the cost of power for a specific apartment building in each neighborhood. A file called ElectriicConsume.tat contains details regarding the amount of electricity used by each home during the specified number of days, and the file Days.txt contain number of days regarding to each consume (Example: If the first line of the file Days.txt contains 15 and the first line of ElectriicConsume.txt contains 157, then 157 Kilowatts of electricity were consumed over the course of 15 days.). The program's objective is to calculate the cost of energy for each apartment based on the quantity of Kilowatts consumed and the cost of each Kilowatt. The program's other goal is to estimate the cost of each apartment based on average consumption across all units and to specify the degree of accuracy for each estimate. The program should use different functions to calculate the Exact electric fees for each apartment based on the price of Kilowatt and the addition of tax, as shown in the equation below. Other function specifies to calculate the Aproximate Electric Fees based on the total number of days and total electric consumed for all apartments, Other function that specifies to define the level of accuracy based on the difference between exact and approximate values A specific file called ExactFeess,tat must include the values of ExactFees, which represent the exact fees for each apartment. A particular file called ApproximateFees.txt will be used to store the values of ApproximateFees for each apartment. This file contains all approximate Fees for all apartments (Append is needed here). The Value of Accuracy for each apartment will be written to a specific file called Accuracy.tst Moreover, the values of accuracy for each apartment approximate fees will be written to the sereen. Imprtant Equations and constructions Exact Electric fees- No.Kw Consumed por day * Price + Tax. Price for the consuming between 0-50 Kw is e.65Nice per Kw and the Tax is 13.5\% Price for cossaming between 50-150Kw is a.82 Nic per Kw and the Tas is 14.8\% Price for caasuming mare 150 is 0.55Nike and the Tax is 16.5% Amount of Electric Consumed Per day - Total Number of electric consumed/ Total number of days. Accuracy = ABS(ExactFer- ApproximateFers) (ExactFees+ApreximateFees)/2)100. Sample Run for Assignment when I print everything needed on the screen as seen in the following screenshot You should be aware that this screen-printing process is only being done to ensure everything goes as planned; writing and reading every file is necessary. The value of Consumamount is: 57.009000 No Days is: 12.00000 ExactFees is: 55.290090 The value of ConsumAmount is: 812.09090 No Days is: 14.600690 ExactFees is: 901.320909 The value of Consumamount is: 530.090900 No Days is: 16. 0696e ExactFees is: 588.30000 The value of ConsumAmount is: 430.000000 No Days is: 16.00900 Exactfees is: 477.300090 The value of ConsumAmount is: 510. 090901 No Days is: 22. 800009 ExactFees 1s: 566.100000 A11 Days is: 80. 800900 Total Consume is: 2339.809000 The Approx fees for Appartment 1 is: 350.850000 The Approx fees for Appartment 2 is: 409.325000 The Approx fees for Appartment 3 is: 467.800000 The Approx fees for Appartiment 4 is: 467.860600 The Approx fees for Appartment 5 is: 643.225066 The Accuracy for the Appartment number: 1 is: 36.317526 The Accuracy for the Appartment number: 2 is: 21.961874 The Accuracy for the Appartment number: 3 is: 12.617793 The Accuracy for the Appartment number: 4 is: 7.697318 The Accuracy for the Appartment number: 5 is: 11.723649

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

find all matrices A (a) A = 13 (b) A + A = 213

Answered: 1 week ago