这个怎么编写
Write a program that will calculate and print bills for the city power company. The rates vary depending on whether the use is residential, commercial or industrial. A code of R means residential use, a code of C means commercial use and a code of I means industrial use. Any other code should be treated as an error. The rates are computed as follows:R: ₤4.00 plus ₤0.03 per kwh (kilowatt-hour) used
C: ₤40.00 for the first 1000kwh and ₤0.025 for each additional kwh.
I: Rate varies depending on time of usage:
• Peak Hours: ₤50.00 for the first 1000 kwh and
₤0.04 for each additional kwh
• Off-Peak Hours: ₤30.00 for the first 1000 kwh and
₤0.02 for each additional kwh.
Your program should prompt the user to enter an integer account number and the use code (type char). Depending on the account type selected the user should be prompted to provide the consumption figures in whole numbers of kilowatt-hours. The program should display the account number and the amount due from the user.
The calculation of the amount due for each account type should be performed by three functions:
1. residential: a function that returns a double and takes an input argument of type int This function should be used to compute the bill for residential customers.
2. commercial: a function that returns a double and takes one input argument of type int. This function should be used to compute the bill for commercial customers.
3. industrial : a function that returns a double and takes two input arguments of type int (peak and off_peak). This function should be used to compute the bill for industrial customers.
大哥 大姐们。。这个怎样编写呀。。谢谢啦。。十分感谢