Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#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 but i want to know what the errors

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

6. Have you used solid reasoning in your argument?

Answered: 1 week ago