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

Convert the Switch Statement into an If/else statement (C++Form) #include <iostr

ID: 3617531 • Letter: C

Question

Convert the Switch Statement into an If/else statement (C++Form)

#include <iostream>
using namespace std;
int menu();
void printmenu();
void enter(int &,string[],string[],int[]);
void search(int ,string[],string[],int[]);
void sort(int ,string[],string[],int[]);
int main()
{ string course[100],prof[100];
int cap[100],choice,count=0;
choice=menu();
while(choice!=4)
    {switch(choice)
       {case1:enter(count,course,prof,cap);
              break;
        case2:search(count,course,prof,cap);
              break;
        case3:sort(count,course,prof,cap);
              break;
        }
     choice=menu();
     }
return 0;
}

Explanation / Answer

please rate - thanks since any errors in input are already taken care of you don't needa final catall else #include using namespace std; int menu(); void printmenu(); void enter(int &,string[],string[],int[]); void search(int ,string[],string[],int[]); void sort(int ,string[],string[],int[]); int main() { string course[100],prof[100]; int cap[100],choice,count=0; choice=menu(); while(choice!=4)    {if(choice==1)          enter(count,course,prof,cap);      else if(choice==2)          search(count,course,prof,cap);      elseif(choice==3)                   sort(count,course,prof,cap);      choice=menu();      } return 0; } void sort(int n,string c[],string p[],int cap[]) {int i,j,t; string st; cout