1、 int level; int age; string occupation; string hobby; string email;user:user(string name,int level,int age,string occupation,string hobby,string email):name(name),age(age),occupation(occupation),hobby(hobby),email(email) ofstream outfile; (,ios:app); outfilename levelageoccupationhobbyemailendl; ();
2、void user:writeuser() coutname;s level:level;s age:age;s occupation:occupation;s hobby:hobby;s email:email;istream &u) in return in;/*/第二部分:电影类 class movie movie() movie(string name):name(name) movie(string name,int year, string direct,string role,string company,string grade); movie() void writemoiv
3、e(); string getmoviename()return name;in,movie &m); friend class comment; int year; string direct; string role; string company; string grade;movie:movie(string name,int year, string direct,string role,string company,string grade):name(name),year(year),direct(direct),role(role),company(company),grade
4、(grade)yeardirectrolecompanygradevoid movie:writemoive() please enter movieplease enter the movie release year:year;s direct:direct;s role:role;please enter the film production company:company;Please enter the movie classification:grade;m)/*/第三部分:影评类 class comment comment(movie moviecomment); commen
5、t(movie moviecomment,user usercomment,double score,string connection); comment() void writecomment(user rcomment); string username; string moviename; double score; string connection; static int commentcount;int comment:commentcount=0;comment:comment(movie moviecomment) commentcount+; moviename=(); c
6、outconnection;comment(movie moviecomment,user usercomment,double score,string connection):score(score),connection(connection) moviename=(); username=();movienameusernamescoreconnectioncommentcountvoid comment:writecomment(user usercomment)please rate the film:score;/*/第四部分:菜单系统功能函数编辑部分 void initiali
7、zation()Menu system ready movie Zootopia(Zootopia ,2016, Howard ,Jodie Disney PG); movie Begonia (Begonia LiangXuanchun Enlight movie Doraemon(Doraemon ShinosukeDoraemonToho PGvoid writenewuser()you can add users infomation: user newuser;void readuser()this is username level age occupation hobby ema
8、il ifstream in( char p; while(p) (p);void writenewmoive() movie newmovie;void readmovie()this is moviemoviename year direct role company gradevoid writenewcomment()you can add movie user commentuser; movie commentmovie;you can add commentplease enter your name:commentuser;please enter moivecommentmo
9、vie; comment newcomment(commentmovie); (commentuser);void readcomment()this is commentmoviename username score connection commentcountvoid clearing()Menu system clearing ( ();/*/第五部分,菜单系统实现部分 void menuframe()* Welcome to the movie critic information management system *- enter 1 make menu system read
10、y - enter 2 look up users infomation enter 3 increase user enter 4 look up moive enter 5 increase moive enter 6 look up comments infomaition enter 7 increase comment enter 8 make menu system clearing enter 0 exit menu system int menuinput() int order;please enter the menu order:order; return order;v
11、oid menuimplementation(int order) switch(order) case 0: exit(0); break; case 1: initialization(); break; case 2: readuser(); case 3: writenewuser(); break; case 4: readmovie(); case 5: writenewmoive(); case 6: readcomment(); case 7: writenewcomment(); case 8: clearing(); default:your input wrong,please re-enter the instruction! /第六部分:主函数 int main() menuframe(); while (true) * int instruct = menuinput(); menuimplementation(instruct); return 0;
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1