Home > Back-end >  A question about the C code
A question about the C code

Time:09-24

# include "stdafx. H"
# include "Member. H"
# include "MemberMenu. H"



Int _tmain (int arg c, _TCHAR * argv [])
{
MemberMenu * musMember=new MemberMenu ();
Member * mem;
String name;
String password;
Int choise.
While (1)
{




Cout & lt; <"Welcome to use * * * 2016 songs management system" & lt; Cout & lt; <"* * * * * * * * * * * * * * * * * * * * * * * *" & lt; Cout & lt; <"* * -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * *" & lt; Cout & lt; <"* | 1. Add 2 songs. | * delete songs" & lt; Cout & lt; <"* | | *" & lt; Cout & lt; <4. "* | 3. Modify the songs find songs | *" & lt; Cout & lt; <"* | | *" & lt; Cout & lt; <"* | 5. Song list 6. Save the song | *" & lt; Cout & lt; <"* | | *" & lt; Cout & lt; <"* | 7. Read the song list 8. Exit system | *" & lt; Cout & lt; <"* | | *" & lt; Cout & lt; <"* * -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * *" & lt;
Cout<& lt;" Please choose the services you need: "& lt; int number;
Cin & gt;> Number;
If (number<1 | | number> 8)
{
Cout<& lt;" Please select the correct operating option!" system("pause");
continue;

}
The switch (number)
{
Case 1:
Mem=new Member ();
Cout<& lt;" Please enter the name songs: ";
Cin> Mem - & gt; name;
Cout<& lt;" Comments: ";
Cin> Mem - & gt; Score;
MusMember - & gt; AddMem (mem);
system("pause");
System (" CLS ");
break;
Case 2:
Cout<& lt;" Delete the song "& lt; Cout<& lt;" Please input to delete the name of the song: ";
Cin> name;
If (musMember - & gt; DeleteMem (name))
{
Cout<& lt;" Delete "success & lt;
} the else
{
Cout<& lt;" Delete failed "& lt;
}
system("pause");
break;

Case 3:
Cout<& lt;" Modify the songs name "& lt; Cout<& lt;" Please enter the need to modify the name of the song: ";
Cin> name;
Mem=new Member ();
Cout<& lt;" Please input the correct song name: "& lt; Cin> Mem - & gt; name;
Cout<& lt;" Comments: "& lt; Cin> Mem - & gt; Score;
If (musMember - & gt; UpdateMem (name, mem))
{
Cout<& lt;" Modify success "& lt; } the else
{
Cout<& lt;" Modify the failure "& lt; }

system("pause");
break;
Case 4:
Cout<& lt;" To find the song name "& lt; Cout<& lt;" Please input to find the name of the song: ";
Cin> name;
Choise=musMember - & gt; FindMem (name);
If (choise==1)
{
Cout<& lt;" Could not find "& lt;
} the else
{
Cout<& lt;" OK, found, its location is: "& lt; }
system("pause");
break;
Case 5:
Cout<& lt;" Song list "& lt; MusMember - & gt; The list ();
system("pause");
break;
Case 6:
MusMember - & gt; SaveData ();
system("pause");
break;
Case 7:
MusMember - & gt; LoadData ();
system("pause");
break;
Case 8:
exit(0);

}
}
return 0;
}
How to add a registration in front of the management system login, after the registration login can directly enter the management system of operation, a great god, just learning c + +

CodePudding user response:

Fyi:
From C to C + + Builder menu interface management system of the graphical user interface, a simple address book example Demo
http://blog.163.com/tab_98/blog/static/1192409720158673337998/
  • Related