I need help i am not sure if i am on the right track.
i have to write a program to calculate the night of nights someone has to stay and what size bed they want. than i have to give a total of cost plus 6% sales tax. her is what i have so far.. i am getting a compiling error at the start of the first "if" statement.
please help
#include <iostream> // required to perform C++ stream I/O
#include <string> //requied to perform string varibles
#include <iomanip> //requied to perform parameterized stream manipulators
using namespace std; // for accessing C++ Standard Library members
int main() //requied for every program;should return integer result code
{
char nights; // store number of nights
char size; // store room type
char response='y'; //store response
while (response!='n' && response!='N') //start of while statement does not run if n/N is typed
{
cout<< "Please enter the numbers of nights you would like to stay:";//propomt for number of nights to stay
cin>>nights; //store the number of nights in variable nights
if (nights<='30') && (nights!='0') // response can not be more than 30 or less than 0
{
cout<<"please enter K for king size bed or Q for queen size bed:";// prompt for bed size
cin>>size;// store the size k or q
}
if (size=='Q')// if Q than true
{
cout<<"n/Total: $" <<nights * 100.00; // output the number of nights times $100.00
}
else
if (size=='K')// if K than true
{
cout<<"n/Total: $" <<nights * 150.00;// output the number of nights times $150.00
}
else (size!='K') && (size!='Q')// if k and q are false than continue
{
cout<<"number of nights must between 1-30";// output error
}
cout<<"Would you like to enter additional nights (y = yes, n = no)?";// prompt for additional nights
cin>>response;// output response
cout<<endl;//add space to make easier to read
}//end while
cout << "\n"; // insert newline for readability
return 0; // indicate that program ended successfully
} // end function main