Home > Back-end >  For help, please help me change the mistake
For help, please help me change the mistake

Time:09-16

# include
# include
# include
using namespace std;
Const int N=5;
The template
The class SeqList
{
Public:
SeqList () {length=0; }
SeqList (DataType a [], int n);
~ SeqList () {}
Int Length () {return Length; }
DataType Get (int I);
Int the Locate DataType (x);
Void Insert (int I DataType x);
DataType Delete (int I);
Void PrintList ();
DataType data [N].
Private:

int length;

};
Struct M
{
Char SeqList;
Char Get;
Char Locate;
Char Insert;
Char Delete;
};
Struct player
{
Int number;
Char name;
Char score;
};
The template
SeqList: : SeqList (DataType a [], int n)
{
Int I, n;
for(i=0; The data I=[I] a [I];
Length=n;
The Menu ();
};
The template
DataType SeqList: : Get (int I)
{
int i;
If (ilength)
Illegal "throw" to find the position;
The else
The return data [I - 1);
The Menu ();
};
The template
Int SeqList: : Locate DataType (x)
{
int i;
For (I=o; If I (data [I]==x)
Return the I + 1;
return 0;
The Menu ();
}
The template
Void SeqList: : Insert (int I, DataType x)
{
int i,j;
If (length>=N)
Throw "overflow";
If (ilength)
"Throw" position;
For (int j j=length; J>=I; J -)
Data [j]=data [j - 1);
The date] [I - 1=x;
length++;
The Menu ();
};
The template
DataType SeqList: : Delete (int I)
{
int i,j;
If (ilength)
Throw "weizhi";
X=data [I - 1);
For (j=I; jData [1]=data [j];
Length -;
Return the x;
The Menu ();
};

Void Menu ()
{
Char choice;
SeqList Func.
System (" CLS ");
Cout<& lt;" Athletes information "& lt; Cout cout cout cout cout cout cin> Choice;
The switch (choice)
{
Case '1' :
Func. SeqList (n);
break;
Case '2' :
Func. Get (I);
break;
Case '3' :
Func. Insert (I);
break;

Case '4' : Func. Delete (I); break; Case '5' : Func. Locate (I); break; Default: break; }

}
Int main ()
{
Player a, [N].
Int M;
Cout<& lt;" Please enter the athlete information: "& lt; For (M=0; M cin> A [M]. Name> A [M]. Number> A [M]. Score;
The Menu ();

return 0;

}
In class to edit this order after the table, when finish with a switch to the error, how should change?
Below is the error message:
Good. CPP
H: \ \ hair good satan. CPP (111) : error C2039: 'SeqList' : is not a member of 'SeqList'
H: \ \ hair good satan. CPP (111) : error C2065: 'n' : undeclared identifier
H: \ \ hair good satan. CPP (114) : error C2065: 'I' : undeclared identifier
An error occurred when executing cl. Exe.

Good. Exe - 1 error (s), and 0 warning (s)
  • Related