Hi, I'm taking a C++ class, and my teacher isn't really clear. Our assignment deals with answering Yes or No questions to figure out a bill for work done. Also involved we have to test the input to make sure that it's there.
Here's what I would like to do:
cout << " Was cleaning performed? (Y or y = yes, N or n = no): ";
cin >> cleaning;
if ( cleaning = ("Y"|| "y") || "N"||"n")
dataOk = true;
cout << "Invalid Data";
if ( cleaning = "Y" || "y")
cbill = 50;
cbill = 0;
Though my compilier doesn't encounter any problems, there is not testing performed for data, and the identifier cbill always equals 50.
Any help would be greatly appreciated!