1. Write an algorithm and a C++ program that will calculate and print bills
for the city power company. The rates vary depending on wheather the use is
residential or commercial. A code R
means residental use and a code of C means commeercial use. Any other code
should be treated as an error.
The rates are computes as follows:
R: RM5.00 Plus RM0.31 per KWH used
C: RM50.00 for the first 1000KWH and RM0.45 for each additional
KWH.
Your program should prompt the user to enter an integer
account number, the use code (type char), and the necessary consumption figures
in whole numbers of kilowatt-hours. Your program should display the amount due
for the user.
2. Write
an algorithm and a C++ program that prompts the user to enter the number of
students and each student's id and score, and finally displays the student
with the highest score.
No comments:
Post a Comment