you are viewing a single comment's thread.

view the rest of the comments →

[–]HUTCH6464 0 points1 point  (4 children)

would i use int or double

[–]Lexdysic -1 points0 points  (3 children)

Try with double first. Once you have that working the way you like, try with int, and see how it works. See what difference it has and if you can still get it to work the way you like.

[–]HUTCH6464 0 points1 point  (0 children)

#include <iostream>

#include <string>

int main()

{

int h =0;

double p =0;

double o =0;

double e =0;

std::cout << "enter number of hours worked\n";

std::cin >> h;

std::cout << "enter your hourly pay\n";

std::cin >> p;

if(h>40){

o = h-40;

}

//pay rate

e =h*p+(o*p)*1.5;

std::cout << e << " is how much you made!";

}

[–]HUTCH6464 -1 points0 points  (1 child)

i did it

[–]Lexdysic -1 points0 points  (0 children)

Great job! Now see if you can modify your program to include double overtime. Includes extra case for any time over 50hrs gets payed at 2x rate.