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, 21.06.2019 21:20
Which of the following explains why it took so long for the public to accept the negative health effects of smoking? a)people were waiting for counter reasons, and those were presented.b)scientists had not completely finalized their results, which took 30 years.c)cigarettes were cheaply available and media channels were very inefficient.d)cigarette manufacturers were trying hard to bring an alternative into the market
Answers: 3
question
Physics, 22.06.2019 03:00
Do you agree with scientist’s prediction about the warming of alaska and other polar regions?
Answers: 2
question
Physics, 22.06.2019 11:20
Suppose a diode consists of a cylindrical cathode with a radius of 6.200×10^−2 cm , mounted coaxially within a cylindrical anode with a radius of 0.5580 cm . the potential difference between the anode and cathode is 260 v . an electron leaves the surface of the cathode with zero initial speed (v initial=0). find its speed vfinal when it strikes the anode.
Answers: 1
question
Physics, 22.06.2019 13:00
The magnitude of the amount of energy released by burning a fuel source, measured in energy per unit mass, is called its fuel value. note that the fuel value is the negative of the isobaric specific heat of combustion for the fuel. if all the energy obtained from burning 1.23 pounds of butane with a fuel value of 10.85 kcal/g is used to heat 128.0 kg of water at an initial temperature of 18.3 °c, what is the final temperature? note that 1 lb = 453.6 g.
Answers: 3
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
Social Studies, 17.11.2020 17:40
question
History, 17.11.2020 17:40
Questions on the website: 13722359