Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>;
- #include <cmath>;
- using namespace std;
- int main()
- {
- std::basic_istream<char>;
- std::char_traits<char>;
- double hours{}, wage{}, wage15{}, wage2{}, holiday2{}, bday{}, totalwage{}, holiday{}, birthdaywagey{}, birthdaywage{}, totalholiday{}, endtotal{}, endtotalwage{}, y{}, n{}; \
- double overtime{}, overtime2{};
- char op{};
- cout << " How many hours did you work this week? ";
- cin >> hours;
- overtime = (hours > 40 < 60);
- overtime2 = (hours > 60 < 80);
- cout << "\n What is your hourly wage? ";
- cin >> wage;
- if (hours > 40 < 60) {
- wage15 = wage * 1.5;
- }
- else if (hours > 60 < 80) {
- wage2 = wage * 2;
- }
- cout << "\n Were any of the hours holiday hours? If so, how many? ";
- cin >> totalholiday;
- holiday = overtime - totalholiday;
- holiday2 = holiday * (wage * wage);
- cout << "\n Was it your birthday this week? [y/n] ";
- cin >> y;
- cin >> n;
- if (cin >> y) {
- birthdaywagey = (wage * 0.7);
- }
- if (cin >> n) {
- birthdaywage = 0;
- }
- totalwage = (hours * wage) + (overtime * wage15) + (holiday2);
- endtotalwage = totalwage + birthdaywagey;
- cout << "\n You earned: " << endtotalwage << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement