C++观影网站管理系统

上传人:cl****1 文档编号:466855113 上传时间:2023-07-10 格式:DOCX 页数:23 大小:15.25KB
返回 下载 相关 举报
C++观影网站管理系统_第1页
第1页 / 共23页
C++观影网站管理系统_第2页
第2页 / 共23页
C++观影网站管理系统_第3页
第3页 / 共23页
C++观影网站管理系统_第4页
第4页 / 共23页
C++观影网站管理系统_第5页
第5页 / 共23页
点击查看更多>>
资源描述

《C++观影网站管理系统》由会员分享,可在线阅读,更多相关《C++观影网站管理系统(23页珍藏版)》请在金锄头文库上搜索。

1、#include#include#includeusing namespace std;/ 第一部分:用户类class userpublic:user()user(string name):name(name)user(stringname,intlevel,intage,stringoccupation,stringhobby,string email);string getusername()return name;void writeuser();friend istream &operator(istream &in,user &u);private:string name;int l

2、evel;int age;string occupation;string hobby;string email;user:user(stringname,intlevel,intage,stringoccupation,stringhobby,stringemail):name(name),age(age),occupation(occupation),hobby(hobby),email(email)ofstream outfile;outfile.open(userfile.txt,ios:app);outfilenamelevelageoccupationhobbyemailendl;

3、outfile.close();void user:writeuser()ofstream outfile;outfile.open(userfile.txt,ios:app);coutname;coutlevel;coutage;coutoccupation;couthobby;coutemail;coutendl;outfilenamelevelageoccupationhobbyemail(istream &in,user &u)inu.name;return in;/*/ 第二部分:电影类class moviepublic:movie()movie(string name):name(

4、name)movie(string name,int year,stringdirect,stringrole,stringcompany,string grade);movie()void writemoive();string getmoviename()return name;friend istream &operator(istream &in,movie &m);friend class comment;private:string name;int year;string direct;string role;string company;string grade;movie:m

5、ovie(string name,int year,stringdirect,stringrole,stringcompany,stringgrade):name(name),year(year),direct(direct),role(role),company(company),grade(grade)ofstream outfile;outfile.open(moviefile.txt,ios:app);outfilenameyeardirectrolecompanygradeendl;outfile.close();void movie:writemoive()ofstream out

6、file;outfile.open(moviefile.txt,ios:app);coutname;coutyear;coutdirect;coutrole;coutcompany;coutgrade;coutendl;outfilenameyeardirectrolecompanygrade(istream &in,movie &m)inm.name;return in;/*/ 第三部分:影评类class commentpublic:comment(movie moviecomment);comment(movie moviecomment,user usercomment,double s

7、core,stringconnection);comment()void writecomment(user rcomment);private:string username;string moviename;double score;string connection;static int commentcount;int comment:commentcount=0;comment:comment(movie moviecomment)commentcount+;moviename=moviecomment.getmoviename();coutconnection;comment:co

8、mment(moviemoviecomment,userusercomment,doublescore,string connection):score(score),connection(connection)commentcount+;moviename=moviecomment.getmoviename();username=usercomment.getusername();ofstream outfile;outfile.open(commentfile.txt,ios:app);outfilemovienameusernamescoreconnectioncommentcountendl;outfile.close();void comment:

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 活动策划

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号