校园卡系统

只建了一个模型

#include<cstdio>
#include<iostream>
#include<malloc.h>
using namespace std;
int select;            //做全局变量
 
//主菜单 
void menu();
//卡片管理
void cardManage();
//开户 
void openAccount();
//食堂应用
void diningApplication(); 


typedef struct StudentInf{
	char StudentName[20];//学生的姓名 
	char StudentNumber[20];//学生学号 
	char CardNumber[20];//学生卡号 
	bool state;//表示是否销户,0表示销户 
	double money;//校园卡中余额的多少
	int key;//卡的密码 
}Student;

struct Node{
	Student student;
	struct Node* next;
};
//创建链表 
struct Node* creatList()
{
	struct Node* headNode=(struct Node*)malloc(sizeof(struct Node));
	headNode->next=NULL;
	return headNode;
} 
//创建结点
struct Node* creatNode()
{
	struct Node* newNode=(struct Node*)malloc(sizeof(struct Node));	
	cout<<"请输入学号:";
	cin>>newNode->student.StudentNumber;
	cout<<"请输入姓名:";
	cin>>newNode->student.StudentName; 
	newNode->next=NULL;
	return newNode;
} 
//插入节点(前插法)
void insertNode(struct Node* headNode)
{
	struct Node* newNode=creatNode();
	newNode->next=headNode->next;
	headNode->next=newNode;	
}
//主界面 
void menu(){
    system("cls");	//清屏 
    printf("\t\t**************************\n");
    printf("\t\t**华中科技大学校园卡系统**\n");
    cout<<"\t\t**************************"<<endl;
    printf("\t\t*\t请选择\t\t *\n");
    printf("\t\t*  1:卡片管理\t\t *\n");
    printf("\t\t*  2:食堂应用\t\t *\n");
    printf("\t\t*  3:汇总分析\t\t *\n");
    printf("\t\t*  4:退出系统\t\t *\n");
    cout<<"\t\t**************************"<<endl;
}
//卡片管理
void cardManage(){
	system("cls");	//清屏 
    printf("\t\t**************************\n");
    printf("\t\t*********卡片管理*********\n");
    cout<<"\t\t**************************"<<endl;
    printf("\t\t*请选择\t\t\t *\n");
    printf("\t\t*  1:开户\t\t *\n");
    printf("\t\t*  2:销户\t\t *\n");
    printf("\t\t*  3:发卡\t\t *\n");
    printf("\t\t*  4:挂失\t\t *\n");
    printf("\t\t*  5:解挂\t\t *\n");
    printf("\t\t*  6:补卡\t\t *\n");
    printf("\t\t*  7:充值\t\t *\n");
    printf("\t\t*  0: 返回\t\t *\n"); 
    cout<<"\t\t**************************"<<endl;
    scanf("%d",&select);
    switch(select){
  		case 1:
  			system("cls");
			openAccount();
			break;
        case 2:				
          
		   break; 
            
            break;
        case 3:				 
           
           
            break;
        case 4:
		 
		 	break;
		}
} 
//打印
void printList(struct Node* headNode){
	struct Node* pMove=headNode->next;
	while(pMove)
	{
		cout<<pMove->student.StudentNumber<<"  ";
		cout<<pMove->student.StudentName<<"  "<<endl;
		pMove=pMove->next;
	}
} 
struct Node* list=creatList();
//开户 
void openAccount(){
	insertNode(list);
	cout<<"开户成功"<<endl;
	 //printList(list);
	 //openAccount();
}
//食堂应用
void diningApplication(){
	system("cls");	//清屏 
    printf("\t\t**************************\n");
    printf("\t\t*****华中科技大学食堂*****\n");
    cout<<"\t\t**************************"<<endl;
    printf("\t\t*请选择\t\t\t *\n");
    printf("\t\t*  1:窗口1\t\t *\n");
    printf("\t\t*  2:窗口2\t\t *\n");
    printf("\t\t*  3:窗口3\t\t *\n");
    printf("\t\t*  4:窗口4\t\t *\n");
    printf("\t\t*  5:窗口5\t\t *\n");
    printf("\t\t*  0: 返回\t\t *\n"); 
    cout<<"\t\t**************************"<<endl;
}

int main()
{
	menu(); 
	scanf("%d",&select);
    switch(select){
  		case 1:
  			system("cls");
			 cardManage();
			 break;
        case 2:				
           diningApplication();
		   break; 
            
            break;
        case 3:				 
           
           
            break;
        case 4:
		 
		 	break;
		}

	return 0;
}

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

猪八戒1.0

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

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

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

打赏作者

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

抵扣说明:

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

余额充值