A program uses a char variables named membership and an int variables named age.
ID: 3633152 • Letter: A
Question
A program uses a char variables named membership and an int variables named age. The membership variables contains one of the following letters( entered in either uppercase or lowercase): M or N. The letter M stands for member, and the letter N stands for non-member. The program should display the appropriate seminar fee, which is based on a person’s membership status and age. Write the c++ code to display the fee.Seminar fee Criteria
10$ club member less than 65 years old
5$ club member at least 65 years old
20$ non-member
I have got this far
<code>
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
//declare variables, char variables named membership
//declare int age
char membership;
char nonmembership;
int age;
//membership variables contains one of the following letters
// ener age of user
cout << "Enter age: ";
cin >> age;
membership = membership;
//User inputs
cout << "Enter M for member: ";
cin >> m;
cout << "Enter N for non member: ";
cin >> n ;
//check which member appropriate seminar fee
if (65>m=10)
{cout<<"m is 10 and 5";
}
else if(65<m=5)
{cout<<"n is 20 Dollors ";
}
else
{cout<<"member fee and non member fee";
}
//end of if
system("pause");
return 0;
} //end of main function
<code>
Explanation / Answer
473898321393
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.