付费下载
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年阳西县招教考试备考题库带答案解析(必刷)
- 2025年沈阳工业大学工程学院马克思主义基本原理概论期末考试模拟题含答案解析(必刷)
- 2025年陕西工运学院马克思主义基本原理概论期末考试模拟题带答案解析
- 2025年商丘学院单招职业倾向性考试题库带答案解析
- 2025年南京艺术学院马克思主义基本原理概论期末考试模拟题及答案解析(必刷)
- 2025年长兴县幼儿园教师招教考试备考题库及答案解析(必刷)
- 2024年潮安县幼儿园教师招教考试备考题库带答案解析
- 2025年普洱学院马克思主义基本原理概论期末考试模拟题含答案解析(夺冠)
- 2025年阳城县招教考试备考题库附答案解析(夺冠)
- 2025年康平县幼儿园教师招教考试备考题库附答案解析(夺冠)
- 2026年及未来5年市场数据中国带电作业机器人行业市场需求预测及投资规划建议报告
- 锰及化合物职业健康安全防护须知
- 春节后复产复工安全培训
- 森林管护培训
- 2026年北京市房山区公安招聘辅警考试试题及答案
- 军品生产现场保密制度
- DB32-T 5320-2025 疾病预防控制机构检验检测能力建设规范
- 46566-2025温室气体管理体系管理手册
- 数据保护及信息安全方案手册
- 电动重卡的可行性报告
- 中建物资管理手册
评论
0/150
提交评论