Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In the program below, write a while loop that locate and display the membership

ID: 3659105 • Letter: I

Question

In the program below, write a while loop that locate and display the membership fee based on the membership type provided by the user input. //club membership.cpp //membership fee #include using namespace std; int main() //declare arrays char types[5] = {'A', 'B', 'C', 'D', 'E'}; int fees[5] = {100, 110, 125, 150, 200}; //declare variables char memberType = ''; int sub = 0; //get type to search for cout << cin>> memberType; memberType = toupper(memberType); " Please input the Membership type (A, B, C, D, or E): "; //write the loop to locate the position of the membership //end while //if the membership type was locate in the types array, display the membership type and the corresponding fee else dispplay an error cout<<"invalid membership type" << endl; //end if system("pause"); return 0; //end of main function

Explanation / Answer

//Club Membership.cpp - displays the annual //membership fee #include using namespace std; int main(){ //declare arrays char types[5] = {'A', 'B', 'C', 'D', 'E'}; int fees[5] = {100, 110, 125, 150, 200}; //declare variables char memberType = ' '; int sub = 0; int idx=-1; //get type to search for cout memberType; coutmemberType; memberType = toupper(memberType); // write the while loop to locate the position of the membership while(sub
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote