没有合适的资源?快使用搜索试试~ 我知道了~
C++房屋交易系统 编写一个房屋交易系统,用计算机对房屋信息进行日常的管理。要求具有用户登陆界面,用户分为管理员(manager...
5星 · 超过95%的资源 需积分: 10 42 下载量 6 浏览量
2010-12-31
01:44:32
上传
评论 2
收藏 42KB DOCX 举报
温馨提示
试读
14页
c++课程设计,房屋交易系统 编写一个房屋交易系统,用计算机对房屋信息进行日常的管理。要求具有用户登陆界面,用户分为管理员(manager)和用户(user)。管理员具有查询、增加、删除、修改等功能。用户具有查询房屋信息,增加、修改、删除出租/买/卖房屋信息的功能(其中增加,修改,删除功能仅对自己的信息)。要求每条记录包含房屋所在地址(可分区,街道),售价,房龄等信息,根据具体情况设计。
资源推荐
资源详情
资源评论
# dene NULL 0
# include<iostream.h>
# include<string.h>
# include<fstream.h>
# include<stdio.h>
# include<iomanip.h>
//定¡§义°?house 类¤¨¤
class house
{
public:
house *next;
char *Getadd() {return add;}
char *Getstyle() {return style;}
int Getarea() {return area;}
int Getprice() {return price;}
int Gethouseage() {return houseage;}
char *Getstate() {return state;}
void set_information(char *Nadd,char *Nstyle,int Narea,int Nprice,int Nhouseage,char
*Nstate)
{
strcpy(add,Nadd);
strcpy(style,Nstyle);
area=Narea;
price=Nprice;
houseage=Nhouseage;
strcpy(state,Nstate);
}
private:
char add[40];
char style[10];
int area;
int price;
int houseage;
char state[10];
};
//定¡§义°?用®?户¡ì 类¤¨¤
class user
{
public:
user *next;
char *Getname(){return name;}
int GetID(){return ID;}
int Getpassword(){return password;}
void set_information(char *Nname,int id,int passcode)
{
strcpy(name,Nname);
ID=id;
password=passcode;
}
private:
char name[20];
int ID;
int password;
};
//定¡§义°?管¨¹ 理¤¨ª 员¡À 类¤¨¤
class manager
{
public:
manager *next;
char *Getname(){return name;}
int GetID(){return ID;}
int Getpassword(){return password;}
void set_information(char *Nname,int id,int passcode)
{
strcpy(name,Nname);
ID=id;
password=passcode;
}
private:
char name[20];
int ID;
int password;
};
//按 ã¡ä 地 Ì?址¡¤查¨¦询¡¥房¤?屋 Y 的 Ì?信?息¡é
void search_house()
{
char ch[40];
int sum=0;
house *head,*q,*p=new house;
head=p;
char add[40];
char style[10];
int area;
int price;
int houseage;
char state[10];
ifstream le("D:\\house_information.txt");
do
{
cout<<"请?输 º?入¨?您¨² 要°a 查¨¦找¨°的 Ì?房¤?屋 Y 地 Ì?址¡¤:";
cin>>ch;
le>>add>>style>>area>>price>>houseage>>state;
p->set_information(add,style,area,price,houseage,state);
q=p;
while(!le.eof())
{
p=new house;
le>>add>>style>>area>>price>>houseage>>state;
p->set_information(add,style,area,price,houseage,state);
q->next=p;
q=p;
}
q->next=NULL;
le.close();
p=head;
while(p!=NULL)
{
if(strcmp(p->Getadd(),ch)==0)
sum++;
p=p->next;
}
if(sum==0)
cout<<"对?不?起 e,ê?信?息¡é 库 a 中 D 没?有®D 与®?您¨² 输 º?入¨?的 Ì?房¤?屋 Y
地 Ì?址¡¤匹£¤配?的 Ì?房¤?屋 Y 信?息¡é!ê?请?重?新?输 º?入¨?…-…-"<<endl;
else
{
p=head;
while(p!=NULL)
{
if(strcmp(p->Getadd(),ch)==0)
{
cout<<setw(40)<<"地 Ì?址¡¤"<<setw(10)<<"户¡ì 型
¨ª"<<setw(10)<<"面?积 y"<<setw(10)<<"价?格?"<<setw(10)<<"房¤?
龄¢?"<<setw(10)<<"状 Á¡ä 态¬?"<<endl;
cout<<setw(40)<<p->Getadd()<<setw(10)<<p-
>Getstyle()<<setw(10)<<p->Getarea()<<setw(10)<<p->Getprice()<<setw(10)<<p-
>Gethouseage()<<setw(10)<<p->Getstate()<<endl;
}
p=p->next;
}
}
}while(sum==0);
}
//删¦?除 y 房¤?屋 Y 信?息¡é
void delete_house()
{
char ch[40];
house *head,*q,*p=new house;
head=p;
char add[40];
char style[10];
int area;
int price;
int houseage;
char state[10];
int sum=0;
ifstream le1("D:\\house_information.txt");
do
{
cout<<"请?输 º?入¨?您¨² 要°a 删¦?除 y 的 Ì?房¤?屋 Y 地 Ì?址¡¤:";
cin>>ch;
le1>>add>>style>>area>>price>>houseage>>state;
p->set_information(add,style,area,price,houseage,state);
q=p;
while(!le1.eof())
{
p=new house;
le1>>add>>style>>area>>price>>houseage>>state;
p->set_information(add,style,area,price,houseage,state);
q->next=p;
q=p;
}
q->next=NULL;
le1.close();
p=head;
while(p!=NULL)
{
剩余13页未读,继续阅读
资源评论
- yanlancynthia2013-11-11很好,值得学习
- tteyem2012-06-17只有代码,文档里的中文有乱码,不过还是对用c++的一点帮助,谢谢。
- 非洲提督2016-01-12很好用的东西
- 爱吃爱和2014-01-20c的交易程序,认真学习
- alily122013-04-01借鉴一下,值得后辈学习
GentlePunk
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Javascript的影视动画设计源码 - cad
- 基于Java和深度学习的瓦斯浓度预测系统后端设计源码 - 瓦斯浓度预测后端
- Screenshot_20240528_103010.jpg
- 基于Python的新能源承载力计算及界面设计源码 - HAINING-DG
- 基于Java的本科探索学习项目设计源码 - 本科探索
- 基于Javascript和Python的微商城项目设计源码 - MicroMall
- 基于Java的网上订餐系统设计源码 - online ordering system
- 基于Javascript的超级美眉网络资源管理应用模块设计源码
- 基于Typescript和PHP的编程知识储备库设计源码 - study-php
- Screenshot_2024-05-28-11-40-58-177_com.tencent.mm.jpg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功