Question
#include #include using namespace std; int count=0; int size; struct date{ int year; int month; int day; }; struct player{ string id; string name; char
#include #include using namespace std; int count=0; int size; struct date{ int year; int month; int day; }; struct player{ string id; string name; char gender; double score; int age; date dob; }st[size]; void menu(); string compute_performace (double score); void add_record(); player delete_record(int i); void update_record(); void sort_records(); int search(st[] a,int first,int last,int key); void show_record(); void find_max(); void menu(){ cout<<"Menu: "<>size; int num; do{ menu(); cin >> num ; switch(num) { case 1: cout << " A "; break ; case 2: cout << " B " ; break ; case 3: cout << " C" ; break ; case 4: cout << " D " ; break ; case 5: cout << "E" ; break ; case 6: cout<<"F"; break; case 7: cout << " G" ; break ; case 8: cout << "H"; break; case 9: cout<<" Thanks for using our program "; break; default: cout<<"Incorrect menu option "; } }while(num!=9); return 0; } string compute_performace(double score){ if(score>=90.0) return "excellent performance"; else if(score>=80) return "very good performance"; else if (score>= 70) return "very good performance"; else if (score>=60) return "very good performance"; else return "very good performance"; } void add_record() { cout<<"Enter player info: ID:"; cin>>st[count].id; cout<<" Name:"; cin>>st[count].name; cout<<" Gender: "; cin>>st[count].gender; cout<<" Age:"; cin>>st[count].age; cout<<" Date of birth (DD,MM,YYYY) "; cin>>st[count].dob.day>>st[count].dob.month>>st[count].dob.year; cout<<" Score:"; cin>>st[count].score; count++; } player delete_record(int i) { if(count>st[index].score; } void show_record(int i){ if(countst[maxIndex]); maxIndex=i; } cout<<"max score is: "< data[j+1]) { temp = data[j]; data[j] = data[j+1]; data[j+1] = temp; } } } int search(st.score[] a,int first,int last,int key){ int result=0; if(last>first) result=-1; else{ int mid=(first+last)/2; if (key==a[mid]) result=mid; else if(keya[mid]) result=search(a,mid+1,last,key) } return result; } }
it is not complete code and it has a lot of errors i want you to correct it and rewrite the code
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started