Help really confused

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?
1
2
3
4
5
6
7
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-28)                                                followed by value of employeeGrossPay at index employeeNumber – 1 (Exhibit Z, lines 19, 20 and 21)

A-1-3-29)                                INCREMENT employeeNumbe


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/*                                                                                     // 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

                cout << "\t '$' fixed 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 
Last edited on
Topic archived. No new replies allowed.