Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can somebody help me make this work? its producing a zero for the totals and I am not sure why. Its in C++ #include using

Can somebody help me make this work? its producing a zero for the totals and I am not sure why. Its in C++

#include using namespace std;

void getOvertime(int hours, double rate, double overtime, double doubleTime, double total) { if (hours > 37 && hours <= 50) { overtime = ((rate*1.5)*(hours)); total = (hours*rate) + overtime; } else if (hours > 50) { doubleTime = ((rate * 2)*(hours)); total = (hours*rate) + overtime + doubleTime; } else total = hours * rate; }

int main() { int hours; double rate; double overtime = 0.0; double doubleTime = 0.0; double total = 0.0; cout << "how many hours? "; cin >> hours; cout << "What is the rate of pay? "; cin >> rate; getOvertime(hours, rate, overtime, doubleTime, total); cout << "total :" << total << endl; system("pause"); return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions

Question

5. Have you any experience with agile software development?

Answered: 1 week ago