#include <algorithm>
#include <iostream>
#include <windows.h>//调用
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <time.h>
#include <cctype>
#include <map>
#include <set>  //一大批头文件
using namespace std;class Time  //时间类
{
//基类的私有成员定义
private:int month;int day;int year;
//基类的公用成员定义
public:void GetTime(int y,int m,int d)//此函数用来获取时间的年月日{year=y;month=m;day=d;}void CheckTime();//此函数用来检查时间的年月日
} Time1;//声明一个对象Time1void Time::CheckTime()  //时间错误检查
{//判断输入是否符合要求//用if --else 简单语句进行判断if(month>12 ||month<1){MessageBox(NULL,"月份输入错误","错误!",MB_OK);exit(0);}else{if(month==1||month==3 ||month==5||month==7||month==8||month==10||month==12)//宋政在此调试,时间2014/11/15,考虑月份不周全,进行完善{if(day>31 || day<1){MessageBox(NULL,"日期输入错误","错误!",MB_OK);exit(0);}}else{if(month==4||month==6 ||month==9||month==11)//郑志成在此调试,时间2014/11/15,考虑月份不周全,进行完善if(day<1||day>30){MessageBox(NULL,"日期输入错误","错误!",MB_OK);exit(0);}}}if(month==2)if(day>29||day<1){MessageBox(NULL,"日期输入错误","错误!",MB_OK);exit(0);}
}//定义Time类的派生类CFinnance,派生方式的公用派生
typedef class CFinance:public Time
{
//定义派生类的公用成员,也就是在基类的基础上新增加的成员
public:int year,month,day;//定义年月日double Income,Output;//定义收入和支出的变量CFinance *next;//定义一个指针变量
} Infor;void SearchIncomeInfor(Infor *head);//查询收入的函数
void SearchOutputInfor(Infor *head);//查询支出的函数
int menu_select();//菜单的选择函数
void SearchDateInfor(Infor *head);//查找日期的函数//首先创建一个空链表进行存储
Infor *Inforinitlist()    //创建信息空链表
{Infor *head;head=(Infor*)malloc(sizeof(Infor));head->next =NULL;return head;
}int menu_select()
{char *m[6]= {"1.录入财务信息","2.浏览财务信息","3.查询财务信息","4.统计财务信息","5.退出财务系统"};char *c;c=new char[50];do{system("cls");//系统清屏cout<<"\t\t----------财务管理系统总菜单----------------"<<endl<<endl;for(int i=0; i<5; i++)cout<<"\t\t\t"<<m[i]<<endl<<endl;cout<<"请用户做出选择:"<<endl;cout<<"Choice"<<endl;cin>>c;}while(c[0]<'1'||c[0]>'5'||c[1]);return(c[0]-'0');
}void InputFinanceInfor(Infor *head)
{system("cls");//系统清屏cout<<"\t\t------------------输入财务信息---------------------"<<endl<<endl;Infor *p1,*p2,*p3;p3=head;if(NULL!=p3->next){p3=p3->next;}p2=p3;char input,*in;in=&input;do{p1=(Infor*)malloc(sizeof(Infor));cout<<"\t\t\t年份整形变量[int]: ";cin>>p1->year;cout<<endl<<"\t\t\t月份整形变量[int]: ";cin>>p1->month;cout<<endl<<"\t\t\t日期整形变量[int]: ";cin>>p1->day;cout<<endl<<"\t\t\t收入浮点型变量[double]: ";cin>>p1->Income;cout<<endl<<"\t\t\t支出浮点型变量[double]: ";cin>>p1->Output;p2->next=p1;p2=p1;cout<<endl<<"\t是否继续输入?(Yes/No)";cin>>*in;system("pause");//调用系统函数,按任意键继续程序}while(toupper(input)!='No');p2->next=NULL;
}void ListFinanceInfor(Infor *head)
{Infor *p;p=head->next;if(p!=NULL){system("cls");//系统清屏cout<<endl<<"\t\t==========浏览全部财务信息=========="<<endl;while(p!=NULL){cout<<"\t\t-------------------------------------------"<<endl<<endl;cout<<setw(8)<<"\t\t年:"<<p->year<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"\t\t月:"<<p->month<<endl;cout<<setw(8)<<"\t\t日: "<<p->day<<endl;//sewt()是定义字段长度的函数cout<<"\t\t收入情况:"<<p->Income<<endl;cout<<"\t\t支出情况:"<<p->Output<<endl;cout<<"\t\t=================================="<<endl;p=p->next;}}
}//查询总菜单
void SearchMenu(Infor *head)
{Infor *p;p=head->next;int ch;system("cls");//系统清屏cout<<endl<<"**********财务查询**********"<<endl<<endl;cout<<"=========1.支出查询========="<<endl<<endl;cout<<"=========2.收入查询========="<<endl<<endl;cout<<"=========3.日期查询========="<<endl<<endl;cout<<"=========4.返回上层========="<<endl<<endl;cout<<"****************************"<<endl<<endl;cout<<"请用户做出选择:"<<endl;cout<<"Option:";cin>>ch;switch (ch){case 1:SearchOutputInfor(p);system("pause");//调用系统函数,按任意键继续程序break;case 2:SearchIncomeInfor(p);system("pause");//调用系统函数,按任意键继续程序break;case 3:SearchDateInfor(p);system("pause");//调用系统函数,按任意键继续程序break;case 4:system("cls");//系统清屏return;default:break;}
}void SearchOutputInfor(Infor *head)
{Infor *p;p=head;system("cls");//系统清屏cout<<endl<<endl<<"\t\t====================支出查询==============="<<endl;while(p!=NULL){if(0!=p->Output){cout<<setw(8)<<"年:"<<p->year<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"月:"<<p->month<<endl;cout<<setw(8)<<"日:"<<p->day<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"支出:"<<p->Output<<endl;cout<<"\t\t ---------------------------------------"<<endl;}p=p->next;}
}void SearchIncomeInfor(Infor *head)
{Infor *p;p=head;system("cls");//系统清屏cout<<endl<<endl<<"\t\t====================收入查询==============="<<endl;while(p!=NULL){if(0!=p->Output){cout<<setw(8)<<"年:"<<p->year<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"月:"<<p->month<<endl;cout<<setw(8)<<"日:"<<p->day<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"收入:"<<p->Income<<endl;//sewt()是定义字段长度的函数cout<<"\t\t ---------------------------------------"<<endl;}p=p->next;}
}void SearchDateInfor(Infor *head)
{int x,y,z;Infor *p;p=head;cout<<"请输入日期。"<<endl;cin>>x>>y>>z;Time1.GetTime(x,y,z);Time1.CheckTime();cout<<endl<<endl<<"\t\t====================日期查询==============="<<endl;while(x!=p->year||y!=p->month||z!=p->day){if(p->next ==NULL){cout<<"未找到记录!"<<endl;cout<<"\t\t----------------------------------------"<<endl;return;}p=p->next;}system("cls");//系统清屏cout<<setw(8)<<"年:"<<p->year<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"月:"<<p->month<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"日:"<<p->day<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"收入:"<<p->Income<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"支出:"<<p->Output<<endl;//sewt()是定义字段长度的函数cout<<"\t\t ---------------------------------------"<<endl;
}void CalculateMonthInfor(Infor *head)
{int x,y;Infor *p;p=head;system("cls");//系统清屏cout<<endl<<endl<<"\t\t====================按月统计==============="<<endl;cout<<"输入年份,月份!"<<endl;cin>>x>>y;while(p!=NULL){if(x==p->year&&y==p->month){cout<<setw(8)<<"年:"<<p->year<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"月:"<<p->month<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"日:"<<p->day<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"支出:"<<p->Output<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"收入:"<<p->Income<<endl;//sewt()是定义字段长度的函数cout<<"\t\t ---------------------------------------"<<endl;}p=p->next;}
}void CalculateYearInfor (Infor *head)
{int x;Infor *p;p=head;system("cls");//系统清屏cout<<endl<<endl<<"\t\t====================按年统计==============="<<endl;cout<<"输入年份!"<<endl;cin>>x;while(p!=NULL){if(x==p->year){cout<<setw(8)<<"年:"<<p->year<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"月:"<<p->month<<endl;cout<<setw(8)<<"日:"<<p->day<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"支出:"<<p->Output<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"收入:"<<p->Income<<endl;//sewt()是定义字段长度的函数cout<<"\t\t ---------------------------------------"<<endl;}p=p->next;}
}void CalculateDayInfor (Infor *head)
{int x,y,z;Infor *p;p=head;system("cls");//系统清屏cout<<endl<<endl<<"\t\t====================按日统计==============="<<endl;cout<<"输入年份,月份,日期!"<<endl;cin>>x>>y>>z;while(p!=NULL){if(x==p->year&&y==p->month&&z==p->day){cout<<setw(8)<<"年:"<<p->year<<endl;//sewt()是定义字段长度的函数cout<<setw(8)<<"月:"<<p->month<<endl;cout<<setw(8)<<"日:"<<p->day<<endl;cout<<setw(8)<<"支出:"<<p->Output<<endl;cout<<setw(8)<<"收入:"<<p->Income<<endl;//sewt()是定义字段长度的函数cout<<"\t\t ---------------------------------------"<<endl;}p=p->next;}
}//宋政,贾超负责调试,时间2014/11/15针对清屏功能void CalculateInfor(Infor *head)
{Infor *p;p=head->next;int ch;system("cls");//系统清屏cout<<endl<<"**********财务统计**********"<<endl<<endl;//李烁界面创建,时间2014/11/13,进行基本输出语句的使用和完善界面的美化外包cout<<"=========1.按年统计========="<<endl<<endl;cout<<"=========2.按月统计========="<<endl<<endl;cout<<"=========3.按日统计========="<<endl<<endl;cout<<"=========4.返回上层========="<<endl<<endl;cout<<"****************************"<<endl<<endl;cout<<"Option:";cin>>ch;switch (ch){case 1:CalculateYearInfor(p);system("pause");//调用系统函数,按任意键继续程序break;case 2:CalculateMonthInfor(p);system("pause");//调用系统函数,按任意键继续程序break;case 3:CalculateDayInfor(p);system("pause");//调用系统函数,按任意键继续程序break;case 4:system("cls");//系统清屏return;default:break;}
}int main()
{Infor *st,*head=NULL;system("color 1D");//调用系统的界面颜色函数st=Inforinitlist();int choice=0;while(choice!=6){choice=menu_select();switch(choice){case 1:InputFinanceInfor(st);system("pause");//调用系统函数,按任意键继续程序break;case 2:ListFinanceInfor(st);system("pause");//调用系统函数,按任意键继续程序case 3:SearchMenu(st);system("pause");//调用系统函数,按任意键继续程序break;case 4:CalculateInfor(st);system("pause");//调用系统函数,按任意键继续程序break;case 5:exit(0);break;default:;}}return 0;
}//刘继国负责创建主要核心代码。时间2014/11/20日进行最终完善

个人理财管理系统代码相关推荐

  1. SSM框架【硬核】项目--个人理财管理系统项目教程

    今天带大家动手实践一下SSM框架项目: 本系统采用SSM技术进行开发与设计,可以让学员对JavaEE的框架有个全面的认识,并能将实用技能与理论知识进行完美的结合,让学员知其然的同时,也要知其所以然. ...

  2. html5学生信息注册码,JavaScript+HTML实现学生信息管理系统代码示例

    本篇文章小编给大家分享一下JavaScript+HTML实现学生信息管理系统代码示例,文章代码介绍的很详细,小编觉得挺不错的,现在分享给大家供大家参考,有需要的小伙伴们可以来看看. 一.前言 用数组来 ...

  3. 计算机毕业设计-驾考管理系统(项目+文档)驾校考试管理系统代码java项目

    计算机毕业设计-驾考管理系统(项目+文档)驾校考试管理系统代码java项目 注意:该项目只展示部分功能,如需了解,评论区咨询即可. 作者:IT跃迁谷 1.开发环境 开发语言:Java 框架:SSM(S ...

  4. 教师查询系统C语言,C语言教师管理系统代码

    <C语言教师管理系统代码>由会员分享,可在线阅读,更多相关<C语言教师管理系统代码(6页珍藏版)>请在人人文库网上搜索. 1.精选文档#include #include #in ...

  5. 输出教师信息c语言作业,C语言教师管理系统代码(最新整理)

    <C语言教师管理系统代码(最新整理)>由会员分享,可在线阅读,更多相关<C语言教师管理系统代码(最新整理)(7页珍藏版)>请在人人文库网上搜索. 1.include #incl ...

  6. 基于java+Mysql的志愿者管理系统代码分享

    源码编号:F-B03 项目类型:Java EE项目(开源免费) 项目名称:基于jap+Servlet的志愿者管理系统代码(volunteer-web) 用户类型:双角色(志愿者和管理员) 项目架构:B ...

  7. 计算机毕业设计-基于SSM+Vue的公交路线管理系统-java公交管理系统代码

    计算机毕业设计-基于SSM+Vue的公交路线管理系统-java公交管理系统代码 1 开发环境及工具下载 开发语言:Java 架构:B/S 后台:SSM(Spring+SpringMVC+Mybatis ...

  8. java-net-php-python-ssm个人理财管理系统登陆计算机毕业设计程序

    java-net-php-python-ssm个人理财管理系统登陆计算机毕业设计程序 java-net-php-python-ssm个人理财管理系统登陆计算机毕业设计程序 本源码技术栈: 项目架构:B ...

  9. SSM家庭理财个人理财管理系统记账系统

    博主介绍:✌在职Java研发工程师.专注于程序设计.源码分享.技术交流.专注于Java技术领域和毕业设计✌ 项目名称 SSM家庭理财个人理财管理系统记账系统 视频效果 https://www.bili ...

最新文章

  1. 广西2021各校高考成绩查询入口,2021年广西高考成绩排名查询系统,广西高考位次排名查询...
  2. 神策 2021 数据驱动大会丨北京主会场首日直播,拼团早鸟票特惠来袭
  3. OpenCV学习笔记之 ( 三 ) MFC显示Mat图片
  4. javascript模板库jsrender加载并缓存外部模板文件
  5. 【应用推荐】用狗屁不通文章生成器写文章
  6. yolov3从头实现(二)-- 数据增强
  7. 03、了解自动配置原理笔记
  8. linux可执行文件bad interpreter解决方法
  9. 计算机科学导论3000,计算机网络导论论文_大一计算机科学导论论文_计算机导论论文3000字...
  10. 电子元件-555时基芯片
  11. wsl使用ssh连接
  12. AMOS分析技术:验证性因子分析介绍;信度与效度指标详解
  13. Excel运用: Excel的窗口冻结与拆分
  14. 豆瓣电影Top250信息爬取并保存到excel文件中!
  15. python敏感字替换_python如何实现敏感词替换
  16. FRM 5.3业绩衡量比率
  17. Web入门学习笔记1——建立第一个网站
  18. IMS与SFIS关系
  19. 使用ANTLR和Go实现DSL入门
  20. 薄荷英语-day20-20180428-30

热门文章

  1. C++的游戏--贪吃蛇
  2. virtualbox安装androidx86进入console控制台,不能进入启动界面,卡死在detecting android-x86 found at /dev/sda1
  3. java bks证书_如何创建包含客户端证书链的BKS(BouncyCastle)格式的Java密钥库
  4. P12证书转BKS证书
  5. 计算机主板复位电路的组成,教你认识液晶彩电主板中的复位电路
  6. HDU - 1546 Idiomatic Phrases Game
  7. 实现动态基础架构 容易吗?
  8. Java 的大 Class 到底是什么?,java高级程序员面试笔试宝典蔡羽
  9. Error: Java exception was raised during method invocation
  10. 9月20-21日,十位阿里技术大牛带你玩转大流量与高并发