Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Notes: Submit your assignment ( main . c File ) through ITC Assignment Two solution. The assignment should be submitted on the due date; late
Notes: Submit your assignment mainc File through ITC Assignment Two solution. The assignment should be submitted on the due date; late submission will NOT beaccepted for any reason. The assignment is individual effort. Copying the assignment will be treated as a cheatingattempt, which may lead to fail the course. Late Assignments will not be accepted forany reasonCreate a complete C program that includes all necessary functions in order to determine theelectricity costs associated with a certain apartment building in each area. Each apartment'selectricity consumption for the specified number of days is listed in a file namedElectricConpumption.txt and the number of days related to each consume is contained in the fileDays.txt For instance, if the first line of ElectriicConsume.txt includes and the first line ofDays.txt contains then Kilowatts of energy were spent over a period of days Theprogram's goal is to find out how much energy each apartment will cost based on how manykilowatts are used and how much a kilowatt costs. The program's second objective is to calculateeach apartment's electricity consumption in KW using the average consumption of all units.The program should use different functions, such as follows:Function designed to determine each apartment's exact electricity costs before taxes dependingon the cost per kilowatt.Function created to determine the exact fees after taxes by adding the tax value based onconsumption value to the amount of consumption reported on ElectricConsumption.txtFunction designed to calculate the Approximate Electric consumption based on the total numberof days and total electric consumed for all apartments.Function that indicates how the difference between exact and approximate data should be used todefine the percentage of error.A specific file called ExactFeessBT.txt must include the values of Exact Fees before tax, whichrepresent the exact fees before tax for each apartment based on the calculation of electricconsumption and of each KW and the price of KW for category of consumption.A specific file called ExactFeesAT.txt must be created to write the values of exact fees after taxfor each apartment, the value of each line in this file must specified for specific apartment basedon the exact fees before tax plus the value of tax based on the consumption value.A particular file called ApproximateCons.txt will be used to store the values of approximateconsumption based on the total days for each apartment Each line in the file will be specified fora specific apartment The approximation of consumption will be listed for each apartment basedon the number of days used to calculate fees.The Value of Percentage Error for each apartment will be written to a specific file calledErrorPerc.txt the percentage error can be calculated based on the equation below. Each line inthis file must contain the percentage of error for each apartment based on the difference betweenexact consumption and approximate consumption.Imprtant Equations and constructionsExact Electric fees NoKw Price for Kw Tax based on NoKwPrice for the consuming between Kw is Nice per Kw and the Tax is Price for consuming between Kw is Nis per Kw and the Tax is Price for Consumption between KW is Nis per KW and Tax is Price for consuming more than is Nis and the Tax is Amount of Electric Consumed Per day Total Number of electric consumed Totalnumber of days.Approximate Consumption Number of days Amount of Electric Consumed per day;PercentageError ABSExactConsumption ApproximateConsumptionExactConsumptionAproximateConsumptionApproximate Consumption per Day Total Consumption for all apartments. Total Days.Sample Run for Assignment when I print everything needed on the screen as seen in the following screenshotYou should be aware that this screenprinting process is only being done to ensure everything goes asplanned; writing and reading every file is necessary.
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