C++观影网站管理系统_第1页
C++观影网站管理系统_第2页
C++观影网站管理系统_第3页
C++观影网站管理系统_第4页
C++观影网站管理系统_第5页
免费预览已结束,剩余4页可下载查看

付费下载

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、#include<iostream> #include<fstream> #include<cstdlib> using namespace std;/ 第一部分:用户类 class userpublic:user() user(string name):name(name) user(string name,int level,int age,string occupation,string hobby,string email); string getusername()return name;void writeuser();friend istrea

2、m &operator>>(istream &in,user &u);private:string name;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 ou

3、tfile;("",ios:app);"<<age<<" "<<occupation<<"outfile<<name<<" "<<level<<""<<hobby<<" "<<email<<endl;();void user:writeuser()ofstream outfile;("",ios:app);H.co

4、ut<<"enter user's name: cin>>name;H.cout<<"enter user's level: cin>>level;cout<<"enter user's age: "cin>>age;cout<<"enter user's occupation: "cin>>occupation;cout<<"enter user's hobby: cin>

5、;>hobby;H.cout<<"enter user's email: cin>>email;"<<age<<" "<<occupation<<"cout<<endl; outfile<<name<<" "<<level<<""<<hobby<<" "<<email<<endl;();istr

6、eam &operator>>(istream &in,user &u)in>> return in; /*/ 第二部分:电影类 class moviepublic: movie() movie(string name):name(name) movie(string name,int year, string direct,string role,string company,string grade); movie()void writemoive();string getmoviename()return name; friend istr

7、eam &operator>>(istream &in,movie &m); friend class comment;private:string name; 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),

8、company(company),grade(grade) ofstream outfile;("",ios:app);"<<direct<<""<<role<<"outfile<<name<<" "<<year<<""<<company<<" "<<grade<<endl;();void movie:writemoive()ofst

9、ream outfile;("",ios:app);cout<<"please enter movie's name: "cin>>name;cout<<"please enter the movie release year:"cin>>year;H.cout<<"please enter movie's direct: cin>>direct;cout<<"please enter movie's rol

10、e: " cin>>role;cout<<"please enter the film production company: " cin>>company;cout<<"Please enter the movie classification: " cin>>grade; cout<<endl;"<<year<<" "<<direct<<""<<grade<

11、;<endl;"<<role<<"outfile<<name<<" "<<company<<"();istream &operator>>(istream &in,movie &m)in>>return in; /* / 第三部分:影评类class commentpublic:comment(movie moviecomment);comment(movie moviecomment,user usercomment,d

12、ouble score,string connection); 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=();cout<<"video link: " ci

13、n>>connection;comment:comment(movie moviecomment,user usercomment,double score,string connection):score(score),connection(connection)commentcount+; moviename=();username=(); ofstream outfile;"<<score<<"("",ios:app); outfile<<moviename<<" "&

14、lt;<username<<""<<connection<<" "<<commentcount<<endl;();void comment:writecomment(user username=(); ofstream outfile; ("",ios:app); cout<<"please rate the film: " cin>>score; outfile<<moviename<<"&

15、quot;<<connection<<"();/*usercomment)"<<username<<""<<commentcount<<endl;"<<score<<"/ 第四部分:菜单系统功能函数编辑部分void initialization()cout<<"Menu system ready"<<endl;movie Zootopia("Zootopia ",2016, &

16、quot;Howard ","Jodiemovie Begonia ("Begonia ",2016, "LiangXuan","chun movie Doraemon("Doraemon ",2016,void writenewuser()cout<<"you can add user's infomation:"<<endl; cout<<endl;user newuser;();void readuser()cout<<&q

17、uot;this is user's infomation:"<<endl;cout<<endl;cout<<"name level age occupation ifstream in("");char p;while(p)(p);void writenewmoive()movie newmovie;();void readmovie()cout<<"this is movie's infomation:"<<endl;cout<<endl;co

18、ut<<"movienamegrade"<<endl;ifstream in("");char p;year","Disney ","PG");","Enlight","PG");"Shinosuke","Doraemon","Toho "," PG");hobbyemail"<<endl;directrolecompanywhil

19、e(p)(p);void writenewcomment()cout<<"you can add movie's infomation:"<<endl;user commentuser;movie commentmovie;cout<<"you can add comment's infomation:"<<endl; cout<<"please enter your name: " cin>>commentuser;cout<<&qu

20、ot;please enter moive's name: " cin>>commentmovie;comment newcomment(commentmovie); (commentuser);void readcomment()cout<<"this is comment's infomation:"<<endl;connectioncout<<"moviename username score commentcount"<<endl;ifstream in(&qu

21、ot;");char p;while(p)(p);void clearing()cout<<"Menu system clearing"<<endl;ofstream outfile;/HH ();/Illi();ZHH(); /*/ 第五部分,菜单系统实现部分void menuframe()cout<<"*"<<endl; cout<<"* Welcome to the movie critic information management system *"&l

22、t;<endl; cout<<"*"<<endl; cout<<endl;cout<<"cout<<" enter 1 make menu system ready cout<<"cout<<" enter 2 look up user's infomation cout<<"cout<<" enter 3 increase user's infomation"<<

23、endl;"<<endl;"<<endl;"<<endl;"<<endl;"<<endl;"<<endl;cout<<""<<endl;"<<endl;cout<<" enter 4 look up moive's infomation cout<<""<<endl;cout<<" enter 5 inc

24、rease moive's infomation cout<<""<<endl;"<<endl;cout<<" enter 6 look up comment's infomaition cout<<""<<endl;"<<endl;cout<<" enter 7 increase comment's infomation cout<<""<<endl;"<<endl;"<<endl;cout<<" enter 8 make menu system clearing cout<<""<<endl;"<<endl;cout<<" enter 0 exit me

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论