subject
Physics, 17.03.2020 01:20 kristenhernandez74

In Lab 07 we wrote a program to calculate energy bill for residential and business customers. We are going to rewrite that program with value returning functions. Residential customers pay $0.12 per kWh for the first 500 kWh. After the first 500 kWh, the rate is $0.15 per kWh. Business customers pay $0.16 per kWh for the first 800 kWh. After the first 800 kWh, the rate is $0.20 per kWh. Write a program to calculate energy charge. You must write and use the following functions. (a) A main function: Call the value returning function get_user_input, which returns kWh used and customer type. Pass the return values to the value returning function bill_calculator as two arguments. Display the return value of bill_calculator. (b) A get_user_input function: This function has no parameter. It asks the user to enter number of kWh used. Use an input validation loop to ensure that kWh used is not negative. Also ask the user to enter customer type (enter R for residential or B for business). Convert lowercase letter to uppercase. Use an input validation loop to ensure that customer is either R or B. Return kWh used and customer type. (c) A bill_calculator function: This function has two parameters to receive number of kWh used and customer type. Calculate and return the energy charge

ansver
Answers: 2

Another question on Physics

question
Physics, 22.06.2019 00:00
Name three different units of energy used to measure heat and describe what type of situations each is usually used.
Answers: 1
question
Physics, 22.06.2019 01:30
The passing of heat through a material while the material itself stays in place. a. radiation b. conduction c. convection
Answers: 2
question
Physics, 22.06.2019 02:50
Steam is generated in a boiler of a cogeneration plant at 10 mpa and 450°c at a steady rate of 5 kg/s. in normal operation, steam expands in a turbine to a pressure of 0.5 mpa and is then routed to the process heater, where it supplies the process heat. steam leaves the process heater as a saturated liquid and is pumped to the boiler pressure. in this mode, no steam passes through a condenser, which operates at 20 kpa. (a) determine the power produced in the turbine and the rate at which process heat is supplied in this mode. (b) determine the power produced in the turbine and the rate of process heat supplied if only 60 percent of the steam is routed to the process heater and the remainder is expanded to the condenser pressure. (3.32 mw; 9.69 mw; 4.25 mw; 5.82 mw)
Answers: 3
question
Physics, 22.06.2019 16:00
The process of predicting values that extend beyond the range of data points is called absolute value extrapolation interpolation prediction for any given: )
Answers: 2
You know the right answer?
In Lab 07 we wrote a program to calculate energy bill for residential and business customers. We are...
Questions
question
Mathematics, 23.10.2020 22:30
question
Arts, 23.10.2020 22:30
question
Mathematics, 23.10.2020 22:30
question
Mathematics, 23.10.2020 22:30
Questions on the website: 13722367