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 06:00
Suppose water is leaking from a tank through a circular hole of area ah at its bottom. when water leaks through a hole, friction and contraction of the stream near the hole reduce the volume of water leaving the tank per second to cah 2gh , where c (0 < c < 1) is an empirical constant. a tank in the form of a right-circular cone standing on end, vertex down, is leaking water through a circular hole in its bottom. (assume the removed apex of the cone is of negligible height and volume.) (a) suppose the tank is 20 feet high and has radius 8 feet and the circular hole has radius 2 inches. the differential equation governing the height h in feet of water leaking from a tank after t seconds is dh dt = − 5 6h3/2 . if the height of the water is initially 8 feet, how long will it take the tank to empty? (round your answer to two decimal places.)
Answers: 2
question
Physics, 22.06.2019 20:30
What are some important factors to consider when choosing a warm-up before your workout?
Answers: 2
question
Physics, 22.06.2019 22:00
Aviolently rotating column of air is formed around a region of extremely low air pressure above land. which of these weather conditions is most likely to follow? blizzard cyclone tornado hurricane
Answers: 1
question
Physics, 23.06.2019 00:00
You can melt ice by applying pressure because the solid/liquid line has a slope.
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
Mathematics, 05.05.2020 13:38
question
English, 05.05.2020 13:38
question
Social Studies, 05.05.2020 13:38
question
Mathematics, 05.05.2020 13:38
question
Geography, 05.05.2020 13:39
question
Mathematics, 05.05.2020 13:39
Questions on the website: 13722363