Question: please write the script. Thank you. Avista Utilities provides electricity to this area. They use different formulas, called rate schedules, for residential and commercial customers.

please write the script. Thank you.please write the script. Thank you. Avista Utilities provides electricity to this

Avista Utilities provides electricity to this area. They use different formulas, called rate schedules, for residential and commercial customers. Each schedule consists of one or more of the following charges- not every type of customer pays every type of charge: Once your program reads the information for a single customer, it should calculate the electricity bill for that customer. Your program then must output the customer number, all the parameters thate read in pertaining to that customer, and the computed electricity bill. Your program should process customers until a line with a customer number of 000000 is input. e A basic charge- a charge that is levied whether the customer uses any power or not. Once your program detects that a customer number of 000000 has been found, your program must output the total amount of revenue that should be collected. This is the sum of the energy costs that were calculated for all customers that the user supplied to your program while it was running. This means that your program should keep a "running sum" of the revenue collected for each customer as it is executing. After printing the total amount of revenue, your program should terminate. An example input stream for your program is shown in Figure below. The first column is the customer number, the second column is the schedule number pertaining to the customer, and the third column is the energy use for that customer. If a given line corresponds to a small commercial, large commercial, or industrial customer, then column four on that line shows the demand amount for that customer. If a given line corresponds to that of a large commercial or industrial customer, a fifth column in the line will contain a Y or N indicating whether or not the customer qualified for a voltage discount during the billing period. An energy charge- the actual cost of the energy used. Energy is measured in kilowattbours (kWh), and the cost of the energy used is determined by multiplying the kWh by the cost per kWh. The cost per kWh is determined by the schedule for a given customer. On some schedules the cost per kWh varies depending on the total amount of energy used by a customer A demand charge- a cost associated with the maximum rate of energy use, measured in kW. This charge is determined by multiplying the kW rate by the demand charge per kW. This only applies to commercial and industrial customers. A voltage discount -Some customers receive a discount on the demand portion of theirbl, determined by multiplying the discount rate by the demand rate The type of customer is determined by a schedule number. Figure below shows the rate schedule for each type of customer and the charges that are relevant to that customer type. | 178531 459875 11 629875 294653 121144122N 258735 21 20450 31 N 68923711 375960 48657421 25142 7O Y 834765 12 198763 21 335467 15467421 540 851 15 1024 0000O 0.05255 0.06156 1551 28 Energy Rate first 600 k Wh Energy rate - over 600 kWh Schedule 11 -Small commerci Basie charge Energy Ratee Demand rate-first 20 kN Demand rate -over 20 kW Voltage discount 9142 18Y 5413 55 N 1873 4795 44 Y 6.0000O 0.07971 3.50000 Your customer, the chief programmer at Avista, has directed that your program be simple and extensible. Toward this goal, she has specified that your program be composed of a main0 function that makes calls to at least four separate functions that accomplish the following tasks 6.00000 0.07719 charRe Energy Rate Demand rate-first 20 kW Demand rate-over 20 kW Voltage discount (if eligible) Schedule 21-Industrial 3.0000O 0.20000 . Read a line of data for a single customer .Compute the charge for the current customer data Print the customer data and computed charge amount Print the total charge amount computed She also notes that it might make sense to build separate functions to compute the following The charge for a residential customer . The charge for a small commercial customer The charge for a large commercial customer The charge for an industrial customer Energy Rate Demand rate up to 50 kW (fixed rate 225.00000 Demand rate over 50 kW (per kW) Voltage discount (if eligible 0.05022 2.75000 0.20000 For this exercise you are to create a program that will read in a line of information for each customer. Each line contains a 6-digit customer number, followed by a schedule number (the legal values for schedule numbers are 1, 11, 12, and 21), and then the information about that customer's energy usage necessary to compute the bill for that customer. Figure 2 shows some examples of what a line of Avista customer information may look like. Each line in Figure 2 is a line of information pertaining to the energy usage of an Avista customer. All customers have an energy use (kWh); commercial and industrial customers also have a demand amount (kW), and some customers have a character (Y - for yes, N -for no) that indicates whether Avista Utilities provides electricity to this area. They use different formulas, called rate schedules, for residential and commercial customers. Each schedule consists of one or more of the following charges- not every type of customer pays every type of charge: Once your program reads the information for a single customer, it should calculate the electricity bill for that customer. Your program then must output the customer number, all the parameters thate read in pertaining to that customer, and the computed electricity bill. Your program should process customers until a line with a customer number of 000000 is input. e A basic charge- a charge that is levied whether the customer uses any power or not. Once your program detects that a customer number of 000000 has been found, your program must output the total amount of revenue that should be collected. This is the sum of the energy costs that were calculated for all customers that the user supplied to your program while it was running. This means that your program should keep a "running sum" of the revenue collected for each customer as it is executing. After printing the total amount of revenue, your program should terminate. An example input stream for your program is shown in Figure below. The first column is the customer number, the second column is the schedule number pertaining to the customer, and the third column is the energy use for that customer. If a given line corresponds to a small commercial, large commercial, or industrial customer, then column four on that line shows the demand amount for that customer. If a given line corresponds to that of a large commercial or industrial customer, a fifth column in the line will contain a Y or N indicating whether or not the customer qualified for a voltage discount during the billing period. An energy charge- the actual cost of the energy used. Energy is measured in kilowattbours (kWh), and the cost of the energy used is determined by multiplying the kWh by the cost per kWh. The cost per kWh is determined by the schedule for a given customer. On some schedules the cost per kWh varies depending on the total amount of energy used by a customer A demand charge- a cost associated with the maximum rate of energy use, measured in kW. This charge is determined by multiplying the kW rate by the demand charge per kW. This only applies to commercial and industrial customers. A voltage discount -Some customers receive a discount on the demand portion of theirbl, determined by multiplying the discount rate by the demand rate The type of customer is determined by a schedule number. Figure below shows the rate schedule for each type of customer and the charges that are relevant to that customer type. | 178531 459875 11 629875 294653 121144122N 258735 21 20450 31 N 68923711 375960 48657421 25142 7O Y 834765 12 198763 21 335467 15467421 540 851 15 1024 0000O 0.05255 0.06156 1551 28 Energy Rate first 600 k Wh Energy rate - over 600 kWh Schedule 11 -Small commerci Basie charge Energy Ratee Demand rate-first 20 kN Demand rate -over 20 kW Voltage discount 9142 18Y 5413 55 N 1873 4795 44 Y 6.0000O 0.07971 3.50000 Your customer, the chief programmer at Avista, has directed that your program be simple and extensible. Toward this goal, she has specified that your program be composed of a main0 function that makes calls to at least four separate functions that accomplish the following tasks 6.00000 0.07719 charRe Energy Rate Demand rate-first 20 kW Demand rate-over 20 kW Voltage discount (if eligible) Schedule 21-Industrial 3.0000O 0.20000 . Read a line of data for a single customer .Compute the charge for the current customer data Print the customer data and computed charge amount Print the total charge amount computed She also notes that it might make sense to build separate functions to compute the following The charge for a residential customer . The charge for a small commercial customer The charge for a large commercial customer The charge for an industrial customer Energy Rate Demand rate up to 50 kW (fixed rate 225.00000 Demand rate over 50 kW (per kW) Voltage discount (if eligible 0.05022 2.75000 0.20000 For this exercise you are to create a program that will read in a line of information for each customer. Each line contains a 6-digit customer number, followed by a schedule number (the legal values for schedule numbers are 1, 11, 12, and 21), and then the information about that customer's energy usage necessary to compute the bill for that customer. Figure 2 shows some examples of what a line of Avista customer information may look like. Each line in Figure 2 is a line of information pertaining to the energy usage of an Avista customer. All customers have an energy use (kWh); commercial and industrial customers also have a demand amount (kW), and some customers have a character (Y - for yes, N -for no) that indicates whether

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!