C++观影网站管理系统Word格式.docx
《C++观影网站管理系统Word格式.docx》由会员分享,可在线阅读,更多相关《C++观影网站管理系统Word格式.docx(10页珍藏版)》请在冰豆网上搜索。
intlevel;
intage;
stringoccupation;
stringhobby;
stringemail;
};
user:
:
user(stringname,intlevel,intage,stringoccupation,stringhobby,stringemail):
name(name),age(age),occupation(occupation),hobby(hobby),email(email){
ofstreamoutfile;
("
"
ios:
app);
outfile<
<
name<
"
level<
age<
occupation<
hobby<
email<
endl;
();
}
voiduser:
writeuser(){
cout<
enteruser'
sname:
;
cin>
name;
slevel:
level;
sage:
age;
soccupation:
occupation;
shobby:
hobby;
semail:
email;
istream&
u){
in>
returnin;
//************************************************************************************************************
//第二部分:
电影类
classmovie{
movie(){}
movie(stringname):
name(name){}
movie(stringname,intyear,stringdirect,stringrole,stringcompany,stringgrade);
~movie(){}
voidwritemoive();
stringgetmoviename(){returnname;
in,movie&
m);
friendclasscomment;
intyear;
stringdirect;
stringrole;
stringcompany;
stringgrade;
movie:
movie(stringname,intyear,stringdirect,stringrole,stringcompany,stringgrade):
name(name),year(year),direct(direct),role(role),company(company),grade(grade){
year<
direct<
role<
company<
grade<
voidmovie:
writemoive(){
pleaseentermovie'
pleaseenterthemoviereleaseyear:
year;
sdirect:
direct;
srole:
role;
pleaseenterthefilmproductioncompany:
company;
Pleaseenterthemovieclassification:
grade;
m){
//****************************************************************************************************************
//第三部分:
影评类
classcomment{
comment(moviemoviecomment);
comment(moviemoviecomment,userusercomment,doublescore,stringconnection);
~comment(){}
voidwritecomment(userrcomment);
stringusername;
stringmoviename;
doublescore;
stringconnection;
staticintcommentcount;
intcomment:
commentcount=0;
comment:
comment(moviemoviecomment){
commentcount++;
moviename=();
cout<
videolink:
cin>
connection;
comment(moviemoviecomment,userusercomment,doublescore,stringconnection):
score(score),connection(connection){
moviename=();
username=();
moviename<
username<
score<
connection<
commentcount<
voidcomment:
writecomment(userusercomment){
pleaseratethefilm:
score;
//******************************************************************************************************************************
//第四部分:
菜单系统功能函数编辑部分
voidinitialization(){
Menusystemready"
movieZootopia("
Zootopia"
2016,"
Howard"
"
Jodie"
Disney"
PG"
);
movieBegonia("
Begonia"
LiangXuan"
chun"
Enlight"
movieDoraemon("
Doraemon"
Shinosuke"
Doraemon"
Toho"
PG"
voidwritenewuser(){
youcanadduser'
sinfomation:
usernewuser;
voidreaduser(){
thisisuser'
namelevelageoccupationhobbyemail"
ifstreamin("
charp;
while(p))
(p);
voidwritenewmoive(){
movienewmovie;
voidreadmovie(){
thisismovie'
movienameyeardirectrolecompanygrade"
voidwritenewcomment(){
youcanaddmovie'
usercommentuser;
moviecommentmovie;
youcanaddcomment'
pleaseenteryourname:
commentuser;
pleaseentermoive'
commentmovie;
commentnewcomment(commentmovie);
(commentuser);
voidreadcomment(){
thisiscomment'
movienameusernamescoreconnectioncommentcount"
voidclearing(){
Menusystemclearing"
("
();
//******************************************************************************
//第五部分,菜单系统实现部分
voidmenuframe(){
*************************************************************"
*Welcometothemoviecriticinformationmanagementsystem*"
-------------------------------------------------------------"
[enter1][makemenusystemready]"
-------------------------------------------------------------"
[enter2][lookupuser'
sinfomation]"
[enter3][increaseuser'
[enter4][lookupmoive'
[enter5][increasemoive'
[enter6][lookupcomment'
sinfomaition]"
[enter7][increasecomment'
[enter8][makemenusystemclearing]"
[enter0][exitmenusystem]"
intmenuinput(){
intorder;
pleaseenterthemenuorder:
order;
returnorder;
voidmenuimplementation(intorder){
switch(order){
case0:
exit(0);
break;
case1:
initialization();
break;
case2:
readuser();
case3:
writenewuser();
break;
case4:
readmovie();
case5:
writenewmoive();
case6:
readcomment();
case7:
writenewcomment();
case8:
clearing();
default:
yourinputwrong,pleasere-entertheinstruction!
}
//第六部分:
主函数
intmain(){
menuframe();
while(true){
********************************************************************************"
intinstruct=menuinput();
menuimplementation(instruct);
return0;