Newbie question (Please be kind)
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:
Variables:
char xray;
char cavity;
char cleaning;
float xbill;
float cavbill;
float cbill;
float totalbill;
bool dataOk;
cout << " Was cleaning performed? (Y or y = yes, N or n = no): ";
cin >> cleaning;
if ( cleaning = ("Y"|| "y") || "N"||"n")
dataOk = true;
else
cout << "Invalid Data";
Then:
if ( cleaning = "Y" || "y")
cbill = 50;
else
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! :)