diff options
| author | WiserJ <[email protected]> | 2021-10-20 16:44:58 -0700 |
|---|---|---|
| committer | WiserJ <[email protected]> | 2021-10-20 16:44:58 -0700 |
| commit | 21d35d281e268031d4fa2ea42543ead6873aab57 (patch) | |
| tree | 480eb36ca985ad0166e6313d4151d15107423579 | |
| parent | salary program v1 (diff) | |
| download | cst116-lab4-jeffwoit-21d35d281e268031d4fa2ea42543ead6873aab57.tar.xz cst116-lab4-jeffwoit-21d35d281e268031d4fa2ea42543ead6873aab57.zip | |
time program start
| -rw-r--r-- | CST116F2021-Lab4/CST116F2021-Lab4.cpp | 100 |
1 files changed, 61 insertions, 39 deletions
diff --git a/CST116F2021-Lab4/CST116F2021-Lab4.cpp b/CST116F2021-Lab4/CST116F2021-Lab4.cpp index 5979260..2859c0d 100644 --- a/CST116F2021-Lab4/CST116F2021-Lab4.cpp +++ b/CST116F2021-Lab4/CST116F2021-Lab4.cpp @@ -2,62 +2,84 @@ // #include <iostream> +#include <iomanip> using namespace std; -void GetInput(float& salary, int& years_service); -void CalcRaise(float& salary, int years_service); -int CalcBonus(int years_service); -void PrintCalculations(int years_service, float salary, int bonus); +void GetInput(int, int, int); +void DisplayTime(float, float, float); int main() { - int years_service = 0, bonus = 0; - float salary = 0.0; - GetInput(salary, years_service); - CalcRaise(salary, years_service); - bonus = CalcBonus(years_service); - PrintCalculations(years_service, salary, bonus); } -void GetInput(float& sal_input, int& years_service_input) +void GetInput(int hours_input, int minutes_input, int seconds_input) { - do - { - cout << "Please input the salary: "; - cin >> sal_input; - } while (sal_input <= 0); + cout << "Please enter the current hour of day: "; + cin >> hours_input; - do - { - cout << "Please input the years of service: "; - cin >> years_service_input; - } while (years_service_input <= 0); } -void CalcRaise(float& sal_raise, int years_service) +void DisplayTime(float standard_display, float military_display, float hours_display) { - if (years_service > 10) - sal_raise *= 1.1; - else if (years_service <= 10 && years_service >= 5) - sal_raise *= 1.05; - else - sal_raise *= 1.02; -} - -int CalcBonus(int years_service) -{ - int bonus = 0; - bonus = (years_service / 2) * 500; - return bonus; } -void PrintCalculations(int years_service, float salary, int bonus) -{ - cout << "Due to your " << years_service << "years of service, your new salary is $" << salary << " and your bonus is $" << bonus << ".\n"; -} +//p.214 +//void GetInput(float& salary, int& years_service); +//void CalcRaise(float& salary, int years_service); +//int CalcBonus(int years_service); +//void PrintCalculations(int years_service, float salary, int bonus); +// +//int main() +//{ +// int years_service = 0, bonus = 0; +// float salary = 0.0; +// +// GetInput(salary, years_service); +// CalcRaise(salary, years_service); +// bonus = CalcBonus(years_service); +// PrintCalculations(years_service, salary, bonus); +//} +// +//void GetInput(float& sal_input, int& years_service_input) +//{ +// do +// { +// cout << "Please input the salary: "; +// cin >> sal_input; +// } while (sal_input <= 0); +// +// do +// { +// cout << "Please input the years of service: "; +// cin >> years_service_input; +// } while (years_service_input <= 0); +//} +// +//void CalcRaise(float& sal_raise, int years_service) +//{ +// if (years_service > 10) +// sal_raise *= 1.1; +// else if (years_service <= 10 && years_service >= 5) +// sal_raise *= 1.05; +// else +// sal_raise *= 1.02; +//} +// +//int CalcBonus(int years_service) +//{ +// int bonus = 0; +// +// bonus = (years_service / 2) * 500; +// return bonus; +//} +// +//void PrintCalculations(int years_service, float salary, int bonus) +//{ +// cout << "Due to your " << years_service << "years of service, your new salary is $" << salary << " and your bonus is $" << bonus << ".\n"; +//} //pg.207 |