Answer to Question #249849 in C++ for Kate

Question #249849
How can I fix the error there of
Cin>> choice;
If (choice !='y')

And

Cout<<"pay the fare:";
Cin>> pay;

Since it says both are not declared in this scope.

Pleas help
1
Expert's answer
2021-10-12T00:37:34-0400

Write the keywords in small letters. Below is a complete program



#include<iostream>
using namespace std;
int main(){
	cout<<"Enter choice:\n";
	char choice;
	cin>>choice;
	if(choice != 'y'){
		cout<<"pay the fare\n";
		int pay;
		cin>>pay;
		cout<<pay<<endl;
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS