an electical company charges the following rates to domestic users to discourage large consumption of energy

for the first 100 units====== $40/unit
for the next 200 units====== $50/unit
beyond 300 units====== $60/unit

all users are charged a minimum of $ 18 000.00 if the total cost is more than 14 thousand dollars then an addittional surcharge of 15% is added.
a) write a program to read the names , surnames, age , sex , address and number of units consumed and then it prints out the list of the charge with name and surname.
b) write a program that print out the same list as in a) but sorted in ascending order of units consumed  

audrey , Thank you for your question.

Is this homework?

It is against my policy to do homework questions. I can help you with work that you have already done, but I cannot give you full answers.

Please attempt to do part of the work, and then ask a specific question when you get stuck.

Learning can be difficult, but doing your own work will repay your effort with good grades in school and success in your career.

David Spector


All Answers

Answers by Expert:

Ask Experts


David Spector


Highly knowledgeable in the C++ language, Visual C++ (MSVC), Windows API, documentation and other quality-assurance techniques, and debugging. Knowledgeable in MFC, COM, GUI design, and object-oriented design.


I have been a software engineer since 1965. I have been published. My specializations have been: biomedical programming, compiler implementation, and many kinds of Windows programming. I don't do Databases or other business-oriented stuff.

Windows?/DOS Developer's Journal, ACM SIGPLAN Notices, and Computer Science Press.

ICCP Systems Programming Certification
Master's degree equivalent in Computer Science

©2017 About.com. All rights reserved.