Answered step by step
Verified Expert Solution
Link Copied!

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 submission will

image text in transcribed
image text in transcribed
image text in transcribed
Notes: - Submit your assignment (main.c File) through ITC Assignment Two solution. - The assignment should be submitted on the due date; late submission will NOT be accepted for any reason. - The assignment is individual effort. Copying the assignment will be treated as a cheating attempt, which may lead to fail the course. (Late Assignments will not be accepted for any reason) Create a complete C program that includes all necessary functions in order to determine the electricity costs associated with a certain apartment building in each area. Each apartment's electricity consumption for the specified number of days is listed in a file named ElectricConpumption.txt. and the number of days related to each consume is contained in the file Days.txt (For instance, if the first line of ElectriicConsume.txt includes 157 and the first line of Days.txt contains 15 , then 157 Kilowatts of energy were spent over a period of 15 days). The program's goal is to find out how much energy each apartment will cost based on how many kilowatts are used and how much a kilowatt costs. The program's second objective is to calculate each 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 depending on the cost per kilowatt. Function created to determine the exact fees after taxes by adding the tax value based on consumption value to the amount of consumption reported on ElectricConsumption.txt. Function designed to calculate the Approximate Electric consumption based on the total number of days and total electric consumed for all apartments. Function that indicates how the difference between exact and approximate data should be used to define the percentage of error. A specific file called ExactFeess BT.txt must include the values of Exact Fees before tax, which represent the exact fees before tax for each apartment based on the calculation of electric consumption and of each KW and the price of KW for category of consumption. A specific file called ExactFees AT.txt must be created to write the values of exact fees after tax for each apartment, the value of each line in this file must specified for specific apartment based on 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 approximate consumption based on the total days for each apartment (Each line in the file will be specified for a specific apartment). The approximation of consumption will be listed for each apartment based on the number of days used to calculate fees. The Value of Percentage Error for each apartment will be written to a specific file called ErrorPerc.txt , the percentage error can be calculated based on the equation below. Each line in this file must contain the percentage of error for each apartment based on the difference between exact consumption and approximate consumption. Imprtant Equations and constructions Exact Electric fees = No.Kw * Price for Kw+ Tax based on No.Kw. Price for the consuming between 050Kw is 0.65Nice per Kw and the Tax is 13.5% Price for consuming between 50200Kw is 0.7Nis per Kw and the Tax is 14% Price for Consumption between 200400KW is 0.8Nis per KW and Tax is 14.8% Price for consuming more than 400 is 0.9Nis and the Tax is 16.5% Amount of Electric Consumed Per day = Total Number of electric consumed/ Total number of days. Approximate Consumption = Number of days Amount of Electric Consumed per day; PercentageError = ABS(ExactConsumption - ApproximateConsumption) ((ExactConsumption+AproximateConsumption)/2)+100. Approximate 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 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 Cost of Electric for each Appartnent before tax is: 109.900000 The cost of electric for each appartnent after tax is: 125.286000 The Cost of Electric for each Appartnent before tax is: 170.400000 The cost of electric for each appartnent after tax is: 195.619200 The Cost of Electric for each Appartnent before tax is: 58.800000 The cost of electric for each appartnent after tax is: 67.032000 The Cost of Electric for each Appartment before tax is: 53.900000 The cost of electric for each appartment after tax is: 61.446000 The Cost of Electric for each Appartnent before tax is: 312.000000 The cost of electric for each appartment after tax is: 358.176000 The value of current consumption is: 157.000000 The value of current consumption is: 213.000000 The value of current consumption is: 84.000000 The value of current consumption is: 77.090000 The value of current consumption is: 390.000000 The Total Consumption for all apartments is: 921.000000 The number of days for current apartnent is: 16 The number of days for current apartnent is: 26 The number of days for current apartnent is: 12 The number of days for current apartnent is: 11 The number of days for current apartnent is: 36 The Total days for all apartments is: 101 The Average Consumption per day is: 9.118812 The Value of Consumption for Apartment is: 145.900990 The Value of Consumption for Apartment is: 237.089109 The Value of Consumption for Apartment is: 109.425743 The Value of Consumption for Apartment is: 100.306931 The Value of Consumption for Apartment is: 328.277228

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

3rd Edition

0760049041, 978-0760049044

More Books

Students also viewed these Databases questions