C++ annual budget of hospital

So I got this homework and I've been trying to crack it. I know what I need to do, but I don't know how. help plz

In a hospital, there are 3 areas: General Medicine, Pediatrics, and Orthopedics. The annual budget of the hospital is divided according to the following table:

Budget Percentage Area
General Medicine 40%
Pediatrics 30%
Orthopedics 30%

Obtain the amount of money that each area will receive, for any budget amount. The file contains the number of dollars and the area.
Do you understand the mathematics of the problem? If the total budget is 100, how much does General Medicine receive?
It receives the 40% of the budget which would be like GM=budget*0.40

The same is applied to the rest, but with a different percentage, depending on what they're asking me.

So it would be 100*0.40=40, which is what the GM would receive.
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
using namespace std;

int main()
{
double budget;

cout << "Enter budget: ";
cin >> budget;

cout << "General Medicine's budget is " << budget *0.40 << endl;
cout << "Pediatrics' budget is " << budget *0.30 << endl;
cout << "Orthopedics' budget is " << budget *0.30 << endl;

return 0;
}
Thanx
Topic archived. No new replies allowed.