C++汽车租赁系统

信息包括:租赁人姓名、所租赁的汽车的品牌、所租赁的汽车的型号、汽车出厂时间、租赁定金、总费用。

(2)系统的主要功能如下:

1、汽车租赁信息的录入。

2、汽车租赁信息的查询。

3、汽车租赁信息的修改。

4、汽车租赁信息的删除。

5、显示汽车租赁信息。

废话少说直接上源码: 

#include <iostream>
#include <string>
using namespace std;
struct carinformation
{
	string factory;
	string brand;
	string moder;
	string Ftime;
	string customer;
	string fmoney;
	string tmoney;
};
struct carmenber
{
	carinformation array[1000];
	int size;
};
void addcarinformation(carmenber  *p)
{ if(p->size==1000)
{cout<<"次管理系统已满,无法继续添加租赁信息";}
else
	{cout<<"请输入租赁人姓名"<<endl;
	string name;
	cin>>name;
	p->array[p->size].customer=name;
	cout<<"请输入所租赁汽车的品牌"<<endl;
	string bran;
	cin>>bran;
	p->array[p->size].brand=bran;
	cout<<"请输入汽车的生产厂家"<<endl;
	string factor;
	cin>>factor;
	p->array[p->size].factory=factor;
	cout<<"请输入汽车出厂时间(-年-月-日)"<<endl;
	string time1;
	cin>>time1;
	p->array[p->size].Ftime=time1;
	cout<<"请输入汽车的租赁定金(元)"<<endl;
	string money1;
	cin>>money1;
	p->array[p->size].fmoney=money1;
	cout<<"请输入汽车租赁总费用(元)"<<endl;
	string money2;
	cin>>money2;
	p->array[p->size].tmoney=money2;
	cout<<"录入信息成功!"<<endl;
	p->size++;
	cout<<"请按回车键清屏!"<<en
一个简单的汽车租赁管理系统C++控制台程序): 利用C++实现对汽车和客户信息的增、删、改等操作,并保存。 部分代码: // CarRent.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include "CarData.h" #include "Menu.h" #include"CustomerData.h" int main() { Menu::welcome(); Menu::login(); //登录界面 char choice; int carid, customerid; //汽车编号,客户编号 CustomerData CustomerDB; //客户库 Customer *r; //客户 CarData CarDB; //汽车库 Car *b; //汽车 Menu::showMenu(); //显示菜单 cout <> choice; while (choice != '0') { switch (choice) { case '1': //输入客户编号和要出租的汽车 cout <> customerid; try { if (customerid <= 0) throw 1; } catch (...) { cout << "输入有误,请重新输入"; break; } cout <> carid; try { if (carid <= 0) throw 1; } catch (...) { cout << "输入有误,请重新输入"; break; } r = CustomerDB.search(customerid); if (NULL == r) { cout << "不存在该客户!"; cout << endl; break; } b = CarDB.search(carid); if (b == NULL) { cout << "不存在该汽车!"; cout <borrowCar() == 0) { cout << "该汽车已租出!"; cout <borrowCar(b->getNo()); cout << "你在" <getBorTime()) << "成功出租一辆" <getName() << endl << "每日租金为(不足一天按一天计算):" <getPay(); break; case '2': //归还操作 cout <> customerid; try { if (customerid <= 0) throw 1; } catch (...) { cout << "输入有误,请重新输入"; break; } cout <> carid; try { if (carid <= 0) throw 1; } catch (...) { cout << "输入有误,请重新输入"; break; } r = CustomerDB.search(customerid); //按编号查找 if (r == NULL) { cout << "不存在该客户!" << endl; break; } b = CarDB.search(carid); if (b == NULL) { cout << "不存在该汽车!" <getOnshelf() == 1) { cout << "该汽车已经归还!" << endl; break; } cout << "您成功归还一辆"
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

James Buchanan

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值