










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











#include
cout << "\n Enter the Initial Amount:"; cin >> ia; cout << "\nEnter the number of years:"; cin >> y; cout << "\nEnter the rate of interest (percent per year):"; cin >> r; r = r / 100; /* use this formula to convert rate of interest form point(.) into number*/ f = ia;
for (int i = 1; i <= y; i = i + 1) /using for loop/ { f = f + (f*r); } cout << "\nAt the end of the year the balace will be:" << f; system("pause"); return 0; }
#include
}
#include
while (h != -1) /using while loop and if condition/ { cout << "\nEnter number of hours worked(-1 to End):"; cin >> h;
if (h == -1) { cout << "\n bye bye:"; system("pause"); exit(0); } else { cout << "\nEnter hourly rate of the worker($00.00):"; cin >> r; } { if (h <= 40) /according to Question if hours aren't greater then 40 then no overtime pay/ { s = rh; cout << "\n Salary is:" << s; } else { /if hours are greater then 40 then overtime pay starts/ int e = h - 40; h = h - e; s = rh + (r1.5)e; cout << "\nSalary is:" << s; } } }
return 0; system("pause");
}