The purpose of this lab is to use functions to break up a larger C++ program into smaller sections, and also to experience the use of input redirection. Avista Utilities provides electricity to this area. They use rather complicated formulas to determine the charges for their services. They also use different rate schedules for residential, commercial and industrial customers. Each schedule consists of one or more of the following charges: A basic charge - a charge that is levied whether the customer uses any power or not. An energy charge - the actual cost of the energy used. Energy is measured in kilowatt-hours(kWh), and the cost of the energy used is determined by multiplying the kWh by the cost perk Wh. On the schedules, the amount per kWh varies, depending upon the total amount of energy used. A demand charge - a cost associated with the maximum peak rate of energy use, measured in kW. This charge is either a fixed amount or is determined by multiplying the kW rate by the demand charge per kW. A voltage discount - Some customers receive a discount on the demand portion of their bill, determined by multiplying the discount rate by the demand amount. A voltage discount - Some customers receive a discount on the demand portion of their bill, determined by multiplying the discount rate by the demand amount. Not every type of customer pays every type of charge. The type of customer is determined by a schedule number. The list on the next page summarizes each type of customer and the charges that are pertinent to that customer. For this assignment, you will write a program that will read from SamplelnputFile.txt a 6-digit customer number, a schedule number (one of 1, 11, 12, 21, 25), and the relevant information for a customer's bill. All customers will have an energy use (kWh) - this is the only information required for schedule 1 customers. Other customers will have a demand amount (kW), and schedule 21 and 25 customers will need to have an indication (Y- for yes, N- for no) whether they should receive a voltage discount. Your program should then output the customer number, all the parameters that were input, and the computed electricity bill. For the purposes of this lab, the calculations must not take place in main. Instead, you should perform the calculations for each schedule in a function, and return the resulting charge back to the main in a function, and return the resulting charge back to the main program You can assume that the input in the file contains correct data. Its format is columnar and tab-delimited, and the column names shown here will not be in the file: Customer Number ScheduleNumber EnergyUse DemandAmount 123456 1 800 234567 11 4000 45 345678 21 300000 75 000000 NB: The last line in the data file contains a customer number of 0. This value should be used to terminate your program. Test your program with the provided SampleInputFile, and verify that the results are correct. NB: The data in the file changes each time you hit the check it NB: The data in the file changes each time you hit the "check it" button. So do not use the button until you have tested your code from the command line. Sample Output Avista Utilities Customer Number: 123456 Billed Usage: 800 KWH Basic Charge: Energy Charge: Energy Charge (over): $5.25 $47.42 $17.71 Total Due: $70.37 Avista Utilities Customer Number: 234567 Billed Usage: 4000 KWH Demand Usage: 45 KWH Basic Charge: Energy Charge: Energy Charge (over): Demand Charge: Demand Charge (over): $10.00 $352.66 $25.22 $0.00 $131.25 Demand Charge: Demand Charge (over): $0.00 $131.25 Total Due $519.13 vista Utilities Castomer Number: 345678 Biled Usage: 300000 KWH Demand Usage: 75 KWH Basic Charge: Energy Charge: Energy Charge (over): Domand Charge: Demand Charge (over): Voltage Discount: $0.00 $15657.50 $2669.50 $350.00 $118.75 -$15.00 Total Dues $18780.75 The purpose of this lab is to use functions to break up a larger C++ program into smaller sections, and also to experience the use of input redirection. Avista Utilities provides electricity to this area. They use rather complicated formulas to determine the charges for their services. They also use different rate schedules for residential, commercial and industrial customers. Each schedule consists of one or more of the following charges: A basic charge - a charge that is levied whether the customer uses any power or not. An energy charge - the actual cost of the energy used. Energy is measured in kilowatt-hours(kWh), and the cost of the energy used is determined by multiplying the kWh by the cost perk Wh. On the schedules, the amount per kWh varies, depending upon the total amount of energy used. A demand charge - a cost associated with the maximum peak rate of energy use, measured in kW. This charge is either a fixed amount or is determined by multiplying the kW rate by the demand charge per kW. A voltage discount - Some customers receive a discount on the demand portion of their bill, determined by multiplying the discount rate by the demand amount. A voltage discount - Some customers receive a discount on the demand portion of their bill, determined by multiplying the discount rate by the demand amount. Not every type of customer pays every type of charge. The type of customer is determined by a schedule number. The list on the next page summarizes each type of customer and the charges that are pertinent to that customer. For this assignment, you will write a program that will read from SamplelnputFile.txt a 6-digit customer number, a schedule number (one of 1, 11, 12, 21, 25), and the relevant information for a customer's bill. All customers will have an energy use (kWh) - this is the only information required for schedule 1 customers. Other customers will have a demand amount (kW), and schedule 21 and 25 customers will need to have an indication (Y- for yes, N- for no) whether they should receive a voltage discount. Your program should then output the customer number, all the parameters that were input, and the computed electricity bill. For the purposes of this lab, the calculations must not take place in main. Instead, you should perform the calculations for each schedule in a function, and return the resulting charge back to the main in a function, and return the resulting charge back to the main program You can assume that the input in the file contains correct data. Its format is columnar and tab-delimited, and the column names shown here will not be in the file: Customer Number ScheduleNumber EnergyUse DemandAmount 123456 1 800 234567 11 4000 45 345678 21 300000 75 000000 NB: The last line in the data file contains a customer number of 0. This value should be used to terminate your program. Test your program with the provided SampleInputFile, and verify that the results are correct. NB: The data in the file changes each time you hit the check it NB: The data in the file changes each time you hit the "check it" button. So do not use the button until you have tested your code from the command line. Sample Output Avista Utilities Customer Number: 123456 Billed Usage: 800 KWH Basic Charge: Energy Charge: Energy Charge (over): $5.25 $47.42 $17.71 Total Due: $70.37 Avista Utilities Customer Number: 234567 Billed Usage: 4000 KWH Demand Usage: 45 KWH Basic Charge: Energy Charge: Energy Charge (over): Demand Charge: Demand Charge (over): $10.00 $352.66 $25.22 $0.00 $131.25 Demand Charge: Demand Charge (over): $0.00 $131.25 Total Due $519.13 vista Utilities Castomer Number: 345678 Biled Usage: 300000 KWH Demand Usage: 75 KWH Basic Charge: Energy Charge: Energy Charge (over): Domand Charge: Demand Charge (over): Voltage Discount: $0.00 $15657.50 $2669.50 $350.00 $118.75 -$15.00 Total Dues $18780.75