Post: C++ program question
09-29-2011, 01:38 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); When I try to compile this something about <= and says operator has no effect.

how would i enter these lines in the code? Line A-1-3-27 is where i'm having issues and not the foggest idea of how to go about it. Could yall help or point out what i've done wrong?

    A-1-3-26)                                DISPLAY employee number preceded by newline and tab escape sequence

A-1-3-27) followed by tab escape sequence, dollar sign literal, FIXED, SHOWPOINT SETPRECISION of 2

A-1-3-2Cool Man (aka Tustin) followed by value of employeeGrossPay at index employeeNumber – 1 (Exhibit Z, lines 19, 20 and 21)

A-1-3-29) INCREMENT employeeNumbe


    /*                                                                                     // A-1-1-01

Author: Shawn Main // A-1-1-02

Date Written: December 11, 2011 // A-1-1-02

Course: CSIS 123, Internet // A-1-1-02

Program: Task 06-02, Chapter 4 // A-1-1-02

Program Description: This test, or driver, program, which demonstrates the "while" // A-1-1-02

repetition statement, determines gross pay for each of // A-1-1-02

several employees. The organization pays "straight time" for // A-1-1-02

the first 40 hours worked by each employee and pays // A-1-1-02

"time-and-a-half" for all hours worked in excess of 40 hours. // A-1-1-02

The program prompts the user for hours worked and hourly pay rate // A-1-1-02

for three employees and, from that information, calculates gross // A-1-1-02

pay. A list of employee number and gross pay is displayed after // A-1-1-02

all input as been accepted. // A-1-1-02

Compiler Used: Microsoft Visual C++ 2010 Express // A-1-1-02

SourceFile Name: Payroll.cpp // A-1-1-02

*/ // A-1-1-03

#include <iostream> // A-1-1-04

#include <iomanip> // A-1-1-05 TODO

#include <string> // A-1-1-06

using namespace std; // A-1-1-07

class Payroll { // A-1-1-08

public: // A-1-1-09

void calculateCurrentPayroll() { // A-1-1-10

const double c_maximumHoursWorkedWithoutOvertimePay = 40; // A-1-3-01 TODO

const static int c_inputPromptWidth = 17; // A-1-3-02 TODO

double grossPay; // A-1-3-03

double hoursWorked; // A-1-3-04 TODO

double hourlyPayRate; // A-1-3-05 TODO

const double c_overtimePayRatePremium = 1.5; // A-1-3-06 TODO

int employeeNumber = 1; // A-1-3-07

while (employeeNumber <= getEmployeeCount()) { // A-1-3-08

cout << "\n\tEnter employee", employeeNumber; // A-1-3-09 TODO

cout << "\n\t\tHours Worked"; // A-1-3-10 TODO

cin >> hoursWorked; // A-1-3-11 TODO

cout << "\n\t\tHourly Pay Rate"; // A-1-3-12 TODO

cin >> hourlyPayRate; // A-1-3-13 TODO

if (hoursWorked <= 40) // A-1-3-14 TODO

grossPay = hoursWorked * hourlyPayRate; // A-1-3-15 TODO

else // A-1-3-16 TODO

grossPay = c_maximumHoursWorkedWithoutOvertimePay * hourlyPayRate // A-1-3-17 TODO

+ hoursWorked - c_maximumHoursWorkedWithoutOvertimePay // A-1-3-18 TODO

* hourlyPayRate * c_overtimePayRatePremium; // A-1-3-19 TODO

// // A-1-3-20 TODO

employeeGrossPay[employeeNumber - 1] = grossPay; // A-1-3-21

employeeNumber++; // A-1-3-22

}// while // A-1-3-23

} // function calculateCurrentPayroll // A-1-1-11

void displayCurrentPayroll() { // A-1-1-12

int employeeNumber = 1; // A-1-3-24 TODO

employeeNumber <= getEmployeeCount(); // A-1-3-25 TODO

cout << "\n\temployee number" // A-1-3-26 TODO

"\t" << fixed << showpoint << setprecision(2); // A-1-3-27 TODO

cout << employeeGrossPay[employeeNumber - 1]; // A-1-3-28 TODO

employeeNumber++; // A-1-3-29 TODO

} // A-1-3-30 TODO

// function displayCurrentPayroll // A-1-1-13

int getEmployeeCount() { // A-1-1-14

return c_employeeCount; // A-1-3-31

} // function getEmployeeCount // A-1-1-15

private: // A-1-1-16

const static int c_employeeCount = 3; // A-1-1-17

double employeeGrossPay[c_employeeCount]; // A-1-1-18

}; // class Payroll // A-1-1-19

int main() { // A-1-5-01

Payroll currentPayroll; // A-1-5-02 TODO

string enterKey; // A-1-5-03

cout << "\nTask 06-02, Ch04, Programmed by Shawn Main"; // A-1-5-04

cout << "\n\nProgram Input:"; // A-1-5-05

currentPayroll.calculateCurrentPayroll(); // A-1-5-06 TODO

cout << "\nProgram Output:"; // A-1-5-07 TODO

cout << "\n\t # Gross Pay"; // A-1-5-08 TODO

currentPayroll.displayCurrentPayroll(); // A-1-5-09 TODO

rewind( stdin ); // A-1-5-10 TODO

cout << "\n\nEnd of program: Press <Enter> key to exit program."; // A-1-5-11

getline(cin, enterKey); // A-1-5-12

} // function main // A-1-5-13


Here is what we were given
    A-1-3-01)                DECLARE local named constant double variable named c_maximumHoursWorkedWithoutOvertimePay with a value of 40.0

A-1-3-02) DECLARE local named constant int variable named c_inputPromptWidth with a value of 17

A-1-3-03) DECLARE local double variable named grossPay

A-1-3-04) DECLARE local double variable named hoursWorked

A-1-3-05) DECLARE local double variable named hourlyPayRate

A-1-3-06) DECLARE local named constant double variable named c_overtimePayRatePremium with a value of 1.5

A-1-3-07) DECLARE local int variable named employeeNumber with an initial value of 1



REPETITION HEADER:

A-1-3-0Cool Man (aka Tustin) while employeeNumber is less than or equal getEmployeeCount(), followed by opening brace for body of loop

A-1-3-09) DISPLAY input-prompt-header for employee, preceded by newline and tab escape sequence, follow by employeeNumber and colon (Exhibit Z, lines 5, 9 and 13)

A-1-3-10) DISPLAY hours-worked prompt, preceded by newline and 2 tab escape sequences, COLUMN WIDTH for input prompt, RIGHT JUSTIFICATION (Exhibit Z, lines 6, 10 and 14)

A-1-3-11) ACCEPT user keyboard input for hours worked (Exhibit Z, lines 6, 10 and 14)

A-1-3-12) DISPLAY hourly-pay-rate prompt, preceded by 2 tab escape sequences, COLUMN WIDTH for input prompt, RIGHT JUSTIFICATION (Exhibit Z, lines 7, 11 and 15)

A-1-3-13) ACCEPT user keyboard input for hourly pay rate (Exhibit Z, lines 7, 11 and 15)



DOUBLE-ALTERNATIVE IF HEADER:

A-1-3-14) IF employee did not work overtime THEN

A-1-3-15) ASSIGN value of expression (hoursWorked MULTIPLIED BY hourlyPayRate) TO variable grossPay

A-1-3-16) ELSE

A-1-3-17) ASSIGN value of expression (c_maximumHoursWorkedWithoutOvertimePay MULTIPLIED BY hourlyPayRate

A-1-3-1Cool Man (aka Tustin) PLUS (hoursWorked MINUS c_maximumHoursWorkedWithoutOvertimePay)

A-1-3-19) MULTIPLIED BY hourlyPayRate MULTIPLIED BY c_overtimePayRatePremium) TO grossPay



DOUBLE-ALTERNATIVE IF FOOTER:

A-1-3-20) Enter closing comment for double-alternative if statement



A-1-3-21) ASSIGN value of grossPay TO array element of employeeGrossPay at index employeeNumber - 1

A-1-3-22) INCREMENT employeeNumber



REPETITION FOOTER:

A-1-3-23) Enter closing brace for body of loop
A-1-3-24) DECLARE local int variable named employeeNumber with an initial value of 1



REPETITION HEADER:

A-1-3-25) while employeeNumber is less than or equal getEmployeeCount(), followed by opening brace for body of loop



Display the one-line detail for each employee

A-1-3-26) DISPLAY employee number preceded by newline and tab escape sequence

A-1-3-27) followed by tab escape sequence, dollar sign literal, FIXED, SHOWPOINT SETPRECISION of 2

A-1-3-2Cool Man (aka Tustin) followed by value of employeeGrossPay at index employeeNumber – 1 (Exhibit Z, lines 19, 20 and 21)

A-1-3-29) INCREMENT employeeNumber



REPETITION FOOTER:

A-1-3-30) Enter closing brace for body of loop
A-1-3-31) RETURN value of data member c_employeeCount
A-1-5-01) Enter function header for function main and opening brace for function’s body

A-1-5-02) DECLARE local Payroll object named currentPayroll

A-1-5-03) DECLARE local string variable named enterKey

A-1-5-04) DISPLAY task-id-and-programmer-identification line, placing newline escape sequence before line (Exhibit Z, lines 1 and 2)

A-1-5-05) DISPLAY program-input-heading line, placing 2 newline escape sequences before line (Exhibit Z, lines 3 and 4)

A-1-5-06) CALL currentPayroll object’s calculateCurrentPayroll public member function

A-1-5-07) DISPLAY program-output-heading line, placing newline escape sequence before line (Exhibit Z, lines 16 and 17)

A-1-5-0Cool Man (aka Tustin) DISPLAY column heading line, placing newline and tab escape sequence before 1st column heading and tab escape sequence before 2nd (Exhibit Z, line 1Cool Man (aka Tustin)

A-1-5-09) CALL currentPayroll object’s displayCurrentPayroll public member function

A-1-5-10) CLEAR keyboard buffer

A-1-5-11) DISPLAY end-of-program output line, placing 2 newline escape sequences before line (Exhibit Z, lines 22 and 23)

A-1-5-12) CLEAR keyboard buffer

A-1-5-13) Enter closing brace for body of function main
09-29-2011, 02:21 AM #2
Epic?
Awe-Inspiring
So, you want us to do your homework? Yeah, 1 post, I don't think so.

Sounds like you just realized that CS stands for "Computer Science" not "Counter-Strike".

Furthermore, if you really want our help, your best bet would've been to post the actual error instead of saying "something about <=", which doesn't really tell us anything. Not that I really made any attempt at fixing your code, I will say, that you might want to check lines A-1-3-26 and A-1-3-27, as at least one error resides there.

The following user thanked Epic? for this useful post:

Pichu
09-29-2011, 02:55 AM #3
Yea those lines are where i am lost on what to do. i dont want anyone to do my hw for me. i'm just lost on what to do so some explanation or pointers would be awesome

---------- Post added at 09:55 PM ---------- Previous post was at 09:29 PM ----------

Originally posted by AsianInvasion View Post
So, you want us to do your homework? Yeah, 1 post, I don't think so.

Sounds like you just realized that CS stands for "Computer Science" not "Counter-Strike".

Furthermore, if you really want our help, your best bet would've been to post the actual error instead of saying "something about <=", which doesn't really tell us anything. Not that I really made any attempt at fixing your code, I will say, that you might want to check lines A-1-3-26 and A-1-3-27, as at least one error resides there.


would a-1-3-27 be something like << "\t$" << fixed << showpoint << setprecision(2)
09-30-2011, 04:32 AM #4
Pichu
RIP PICHU.
Originally posted by AsianInvasion View Post
So, you want us to do your homework? Yeah, 1 post, I don't think so.

Sounds like you just realized that CS stands for "Computer Science" not "Counter-Strike".

Furthermore, if you really want our help, your best bet would've been to post the actual error instead of saying "something about <=", which doesn't really tell us anything. Not that I really made any attempt at fixing your code, I will say, that you might want to check lines A-1-3-26 and A-1-3-27, as at least one error resides there.


Nicely worded, there needs to be a format for asking questions about this to make it easier to respond. :/
09-30-2011, 05:21 AM #5
AndreeU
+cM TeamCM GFX 4 Lifee<3
Originally posted by dpsht316 View Post
When I try to compile this something about <= and says operator has no effect.

how would i enter these lines in the code? Line A-1-3-27 is where i'm having issues and not the foggest idea of how to go about it. Could yall help or point out what i've done wrong?

    A-1-3-26)                                DISPLAY employee number preceded by newline and tab escape sequence

A-1-3-27) followed by tab escape sequence, dollar sign literal, FIXED, SHOWPOINT SETPRECISION of 2

A-1-3-2Cool Man (aka Tustin) followed by value of employeeGrossPay at index employeeNumber – 1 (Exhibit Z, lines 19, 20 and 21)

A-1-3-29) INCREMENT employeeNumbe


    /*                                                                                     // A-1-1-01

Author: Shawn Main // A-1-1-02

Date Written: December 11, 2011 // A-1-1-02

Course: CSIS 123, Internet // A-1-1-02

Program: Task 06-02, Chapter 4 // A-1-1-02

Program Description: This test, or driver, program, which demonstrates the "while" // A-1-1-02

repetition statement, determines gross pay for each of // A-1-1-02

several employees. The organization pays "straight time" for // A-1-1-02

the first 40 hours worked by each employee and pays // A-1-1-02

"time-and-a-half" for all hours worked in excess of 40 hours. // A-1-1-02

The program prompts the user for hours worked and hourly pay rate // A-1-1-02

for three employees and, from that information, calculates gross // A-1-1-02

pay. A list of employee number and gross pay is displayed after // A-1-1-02

all input as been accepted. // A-1-1-02

Compiler Used: Microsoft Visual C++ 2010 Express // A-1-1-02

SourceFile Name: Payroll.cpp // A-1-1-02

*/ // A-1-1-03

#include <iostream> // A-1-1-04

#include <iomanip> // A-1-1-05 TODO

#include <string> // A-1-1-06

using namespace std; // A-1-1-07

class Payroll { // A-1-1-08

public: // A-1-1-09

void calculateCurrentPayroll() { // A-1-1-10

const double c_maximumHoursWorkedWithoutOvertimePay = 40; // A-1-3-01 TODO

const static int c_inputPromptWidth = 17; // A-1-3-02 TODO

double grossPay; // A-1-3-03

double hoursWorked; // A-1-3-04 TODO

double hourlyPayRate; // A-1-3-05 TODO

const double c_overtimePayRatePremium = 1.5; // A-1-3-06 TODO

int employeeNumber = 1; // A-1-3-07

while (employeeNumber <= getEmployeeCount()) { // A-1-3-08

cout << "\n\tEnter employee", employeeNumber; // A-1-3-09 TODO

cout << "\n\t\tHours Worked"; // A-1-3-10 TODO

cin >> hoursWorked; // A-1-3-11 TODO

cout << "\n\t\tHourly Pay Rate"; // A-1-3-12 TODO

cin >> hourlyPayRate; // A-1-3-13 TODO

if (hoursWorked <= 40) // A-1-3-14 TODO

grossPay = hoursWorked * hourlyPayRate; // A-1-3-15 TODO

else // A-1-3-16 TODO

grossPay = c_maximumHoursWorkedWithoutOvertimePay * hourlyPayRate // A-1-3-17 TODO

+ hoursWorked - c_maximumHoursWorkedWithoutOvertimePay // A-1-3-18 TODO

* hourlyPayRate * c_overtimePayRatePremium; // A-1-3-19 TODO

// // A-1-3-20 TODO

employeeGrossPay[employeeNumber - 1] = grossPay; // A-1-3-21

employeeNumber++; // A-1-3-22

}// while // A-1-3-23

} // function calculateCurrentPayroll // A-1-1-11

void displayCurrentPayroll() { // A-1-1-12

int employeeNumber = 1; // A-1-3-24 TODO

employeeNumber <= getEmployeeCount(); // A-1-3-25 TODO

cout << "\n\temployee number" // A-1-3-26 TODO

"\t" << fixed << showpoint << setprecision(2); // A-1-3-27 TODO

cout << employeeGrossPay[employeeNumber - 1]; // A-1-3-28 TODO

employeeNumber++; // A-1-3-29 TODO

} // A-1-3-30 TODO

// function displayCurrentPayroll // A-1-1-13

int getEmployeeCount() { // A-1-1-14

return c_employeeCount; // A-1-3-31

} // function getEmployeeCount // A-1-1-15

private: // A-1-1-16

const static int c_employeeCount = 3; // A-1-1-17

double employeeGrossPay[c_employeeCount]; // A-1-1-18

}; // class Payroll // A-1-1-19

int main() { // A-1-5-01

Payroll currentPayroll; // A-1-5-02 TODO

string enterKey; // A-1-5-03

cout << "\nTask 06-02, Ch04, Programmed by Shawn Main"; // A-1-5-04

cout << "\n\nProgram Input:"; // A-1-5-05

currentPayroll.calculateCurrentPayroll(); // A-1-5-06 TODO

cout << "\nProgram Output:"; // A-1-5-07 TODO

cout << "\n\t # Gross Pay"; // A-1-5-08 TODO

currentPayroll.displayCurrentPayroll(); // A-1-5-09 TODO

rewind( stdin ); // A-1-5-10 TODO

cout << "\n\nEnd of program: Press <Enter> key to exit program."; // A-1-5-11

getline(cin, enterKey); // A-1-5-12

} // function main // A-1-5-13


Here is what we were given
    A-1-3-01)                DECLARE local named constant double variable named c_maximumHoursWorkedWithoutOvertimePay with a value of 40.0

A-1-3-02) DECLARE local named constant int variable named c_inputPromptWidth with a value of 17

A-1-3-03) DECLARE local double variable named grossPay

A-1-3-04) DECLARE local double variable named hoursWorked

A-1-3-05) DECLARE local double variable named hourlyPayRate

A-1-3-06) DECLARE local named constant double variable named c_overtimePayRatePremium with a value of 1.5

A-1-3-07) DECLARE local int variable named employeeNumber with an initial value of 1



REPETITION HEADER:

A-1-3-0Cool Man (aka Tustin) while employeeNumber is less than or equal getEmployeeCount(), followed by opening brace for body of loop

A-1-3-09) DISPLAY input-prompt-header for employee, preceded by newline and tab escape sequence, follow by employeeNumber and colon (Exhibit Z, lines 5, 9 and 13)

A-1-3-10) DISPLAY hours-worked prompt, preceded by newline and 2 tab escape sequences, COLUMN WIDTH for input prompt, RIGHT JUSTIFICATION (Exhibit Z, lines 6, 10 and 14)

A-1-3-11) ACCEPT user keyboard input for hours worked (Exhibit Z, lines 6, 10 and 14)

A-1-3-12) DISPLAY hourly-pay-rate prompt, preceded by 2 tab escape sequences, COLUMN WIDTH for input prompt, RIGHT JUSTIFICATION (Exhibit Z, lines 7, 11 and 15)

A-1-3-13) ACCEPT user keyboard input for hourly pay rate (Exhibit Z, lines 7, 11 and 15)



DOUBLE-ALTERNATIVE IF HEADER:

A-1-3-14) IF employee did not work overtime THEN

A-1-3-15) ASSIGN value of expression (hoursWorked MULTIPLIED BY hourlyPayRate) TO variable grossPay

A-1-3-16) ELSE

A-1-3-17) ASSIGN value of expression (c_maximumHoursWorkedWithoutOvertimePay MULTIPLIED BY hourlyPayRate

A-1-3-1Cool Man (aka Tustin) PLUS (hoursWorked MINUS c_maximumHoursWorkedWithoutOvertimePay)

A-1-3-19) MULTIPLIED BY hourlyPayRate MULTIPLIED BY c_overtimePayRatePremium) TO grossPay



DOUBLE-ALTERNATIVE IF FOOTER:

A-1-3-20) Enter closing comment for double-alternative if statement



A-1-3-21) ASSIGN value of grossPay TO array element of employeeGrossPay at index employeeNumber - 1

A-1-3-22) INCREMENT employeeNumber



REPETITION FOOTER:

A-1-3-23) Enter closing brace for body of loop
A-1-3-24) DECLARE local int variable named employeeNumber with an initial value of 1



REPETITION HEADER:

A-1-3-25) while employeeNumber is less than or equal getEmployeeCount(), followed by opening brace for body of loop



Display the one-line detail for each employee

A-1-3-26) DISPLAY employee number preceded by newline and tab escape sequence

A-1-3-27) followed by tab escape sequence, dollar sign literal, FIXED, SHOWPOINT SETPRECISION of 2

A-1-3-2Cool Man (aka Tustin) followed by value of employeeGrossPay at index employeeNumber – 1 (Exhibit Z, lines 19, 20 and 21)

A-1-3-29) INCREMENT employeeNumber



REPETITION FOOTER:

A-1-3-30) Enter closing brace for body of loop
A-1-3-31) RETURN value of data member c_employeeCount
A-1-5-01) Enter function header for function main and opening brace for function’s body

A-1-5-02) DECLARE local Payroll object named currentPayroll

A-1-5-03) DECLARE local string variable named enterKey

A-1-5-04) DISPLAY task-id-and-programmer-identification line, placing newline escape sequence before line (Exhibit Z, lines 1 and 2)

A-1-5-05) DISPLAY program-input-heading line, placing 2 newline escape sequences before line (Exhibit Z, lines 3 and 4)

A-1-5-06) CALL currentPayroll object’s calculateCurrentPayroll public member function

A-1-5-07) DISPLAY program-output-heading line, placing newline escape sequence before line (Exhibit Z, lines 16 and 17)

A-1-5-0Cool Man (aka Tustin) DISPLAY column heading line, placing newline and tab escape sequence before 1st column heading and tab escape sequence before 2nd (Exhibit Z, line 1Cool Man (aka Tustin)

A-1-5-09) CALL currentPayroll object’s displayCurrentPayroll public member function

A-1-5-10) CLEAR keyboard buffer

A-1-5-11) DISPLAY end-of-program output line, placing 2 newline escape sequences before line (Exhibit Z, lines 22 and 23)

A-1-5-12) CLEAR keyboard buffer

A-1-5-13) Enter closing brace for body of function main


lol WoW gud luck bro i would help but im just amazed on what you did pshff lol jkjk>>>> you need a TUT
10-09-2011, 08:55 AM #6
Originally posted by dpsht316 View Post
derp


what was wrong is you were using rewind without including <stdio.h>

    
/* // A-1-1-01

Author: Shawn Main // A-1-1-02

Date Written: December 11, 2011 // A-1-1-02

Course: CSIS 123, Internet // A-1-1-02

Program: Task 06-02, Chapter 4 // A-1-1-02

Program Description: This test, or driver, program, which demonstrates the "while" // A-1-1-02

repetition statement, determines gross pay for each of // A-1-1-02

several employees. The organization pays "straight time" for // A-1-1-02

the first 40 hours worked by each employee and pays // A-1-1-02

"time-and-a-half" for all hours worked in excess of 40 hours. // A-1-1-02

The program prompts the user for hours worked and hourly pay rate // A-1-1-02

for three employees and, from that information, calculates gross // A-1-1-02

pay. A list of employee number and gross pay is displayed after // A-1-1-02

all input as been accepted. // A-1-1-02

Compiler Used: Microsoft Visual C++ 2010 Express // A-1-1-02

SourceFile Name: Payroll.cpp // A-1-1-02

*/ // A-1-1-03

#include <iostream> // A-1-1-04

#include <iomanip> // A-1-1-05 TODO

#include <string> // A-1-1-06

#include <stdio.h>
using namespace std; // A-1-1-07

class Payroll { // A-1-1-08

public: // A-1-1-09

void calculateCurrentPayroll() { // A-1-1-10

const double c_maximumHoursWorkedWithoutOvertimePay = 40; // A-1-3-01 TODO

const static int c_inputPromptWidth = 17; // A-1-3-02 TODO

double grossPay; // A-1-3-03

double hoursWorked; // A-1-3-04 TODO

double hourlyPayRate; // A-1-3-05 TODO

const double c_overtimePayRatePremium = 1.5; // A-1-3-06 TODO

int employeeNumber = 1; // A-1-3-07

while (employeeNumber <= getEmployeeCount()) { // A-1-3-08

cout << "\n\tEnter employee", employeeNumber; // A-1-3-09 TODO

cout << "\n\t\tHours Worked"; // A-1-3-10 TODO

cin >> hoursWorked; // A-1-3-11 TODO

cout << "\n\t\tHourly Pay Rate"; // A-1-3-12 TODO

cin >> hourlyPayRate; // A-1-3-13 TODO

if (hoursWorked <= 40) // A-1-3-14 TODO

grossPay = hoursWorked * hourlyPayRate; // A-1-3-15 TODO

else // A-1-3-16 TODO

grossPay = c_maximumHoursWorkedWithoutOvertimePay * hourlyPayRate // A-1-3-17 TODO

+ hoursWorked - c_maximumHoursWorkedWithoutOvertimePay // A-1-3-18 TODO

* hourlyPayRate * c_overtimePayRatePremium; // A-1-3-19 TODO

// // A-1-3-20 TODO

employeeGrossPay[employeeNumber - 1] = grossPay; // A-1-3-21

employeeNumber++; // A-1-3-22

}// while // A-1-3-23

} // function calculateCurrentPayroll // A-1-1-11

void displayCurrentPayroll() { // A-1-1-12

int employeeNumber = 1; // A-1-3-24 TODO

employeeNumber <= getEmployeeCount(); // A-1-3-25 TODO

cout << "\n\temployee number" // A-1-3-26 TODO

"\t" << fixed << showpoint << setprecision(2); // A-1-3-27 TODO

cout << employeeGrossPay[employeeNumber - 1]; // A-1-3-28 TODO

employeeNumber++; // A-1-3-29 TODO

} // A-1-3-30 TODO

// function displayCurrentPayroll // A-1-1-13

int getEmployeeCount() { // A-1-1-14

return c_employeeCount; // A-1-3-31

} // function getEmployeeCount // A-1-1-15

private: // A-1-1-16

const static int c_employeeCount = 3; // A-1-1-17

double employeeGrossPay[c_employeeCount]; // A-1-1-18

}; // class Payroll // A-1-1-19

int main() { // A-1-5-01

Payroll currentPayroll; // A-1-5-02 TODO

string enterKey; // A-1-5-03

cout << "\nTask 06-02, Ch04, Programmed by Shawn Main"; // A-1-5-04

cout << "\n\nProgram Input:"; // A-1-5-05

currentPayroll.calculateCurrentPayroll(); // A-1-5-06 TODO

cout << "\nProgram Output:"; // A-1-5-07 TODO

cout << "\n\t # Gross Pay"; // A-1-5-08 TODO

currentPayroll.displayCurrentPayroll(); // A-1-5-09 TODO

rewind( stdin ); // A-1-5-10 TODO

cout << "\n\nEnd of program: Press <Enter> key to exit program."; // A-1-5-11

getline(cin, enterKey); // A-1-5-12

} // function main // A-1-5-13


this compiled correctly for me.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo