Answer to Question #167659 in C++ for sara

Question #167659

Write a program to check if the person is eligible to go into a musical concert. For a person to be eligible, they must be over 21, and they must have a ticket. If neither condition is satisfied, the person will not be allowed in. Your program should print “Person is eligible” or “Person is not eligible”. 


1
Expert's answer
2021-03-01T02:04:10-0500
#include <iostream>
 
using namespace std;
 
int main()
{
	int age = 0;
	cout << "Enter a person age: ";
	cin >> age;
	cout << "Have a person ticket(Y/N)? ";
	char ch;
	cin >> ch;
	if (age >= 21 && ch == 'Y') cout << "Person is eligible" << endl;
	else cout << "Person is not eligible" << endl;
	return 0;
}

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