Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- cout << "Category Avail:\n";
- cout << "Full-Time : 5%\n";
- cout << "Part-Time : 2%\n";
- char conf = 'Y';
- string cat;
- double sal;
- int full = 0, part = 0, sum = 0, count = 0;
- for(int i = 0;conf != 'N';count++)
- {
- cout << "Employee category: ";
- cin >> cat;
- cout << "Enter Salary: RM ";
- cin >> sal;
- cout << "Your new Salary after bonus: ";
- if(cat == "Full-Time")
- {
- i = sal * 1.05;
- cout << setprecision(2) << i;
- sum += i;
- full++;
- }
- else
- {
- i = sal * 1.02;
- cout << setprecision(2) << i;
- sum += i;
- part++;
- }
- cout << "\n\nDo you want to continue ( Y/N ): ";
- cin >> conf;
- cout << endl;
- }
- cout << endl;
- cout << "OVERALL AVERAGE NEW SALARY (RM): " << sum / count << endl;
- cout << "NUMBER OF FULL-TIME EMPLOYERS: " << full << endl;
- cout << "NUMBER OF PART-TIME EMPLOYERS: " << part ;
- }
Add Comment
Please, Sign In to add comment