Complete Newb, have a loop that won't exit
Hi, I'm Completely new to this. I'm taking a C++ class where I have to write a payroll program, but somehow the loop I wrote won't exit even when I enter the appropriate variable. Can anyone tell me what I'm doing wrong? Thanks!
Code:
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
//Declare Variables
char H, h, S, s, P, p;
char payCode;
double hrsWorked;
double grossPay;
double otPay;
double payRate;
double regPay;
double totalPay;
int exempt;
//Set decimal points
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
//Input pay code
cout << "Enter pay code (H = hourly, S = Salary, P = Piece Work): ";
cin >> payCode;
//Loop if payCode not equal to: H,h,S,s,P,p
//This part doesn't work, it won't exit loop if H,h,S,s,P,or p are entered
while ( (payCode !=H) || (payCode !=h) ||
(payCode !=S) || (payCode !=s) ||
(payCode !=P) || (payCode !=p) )
{
cout << "Invalid pay type, please try agin. ";
cout << endl;
cout << "Enter pay code (H = hourly, S = Salary, P = Piece Work): ";
cin >> payCode;
}
//Here it should exit the loop to continue with the rest of the program but it doesn't :(