⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cpp

📁 用VB编写了一个有关数据库学生管理的系统,希望对大家有帮助
💻 CPP
字号:
#include<iostream.h>
#include<string.h>
#include<fstream.h>
#include "gelie.h"
#include "ttt.h"
#include<conio.h> 

people pp;
student ss;
teacher tt;
graduate gg;
TA TT;

int main()
{   
    cout<<"*********Welcome to you!***********"<<endl;
    int i;
	char ch;
	
	int t=1; 
	line:do
	{
		cout<<"请选择你需要的人员操作信息"<<endl;
		 cout<<" 1-student 2-teacher 3-graduate 4-TA:";

		cin>>i;
	switch(i)
	{
		case 1:{
			cout<<"i-输入学生的信息	s-查询学生信息"<<endl;
			char j;
			cout<<"请输入i或s:"<<endl;
			 cin>>j;
				switch(j)
				{ case 'i': Set(1);break;
			      case 's':{ 
				         if(studentNO!=0)
						 {
					      for(t=1;t<=studentNO;t++)
						  {   int num;
							  cout<<"请输入要查询的学生学号:";
						      cin>>num;
							  if (num==ss.number)
							  {cout<<"student的信息为:"<<endl;
							   ss.Getstudent1();
							   ss.Getstudent2() ;}
							  else
								  cout<<"没有该学生!";
						  }
						 }
			 
			         	else
						{
					     cout<<"there is no student's message"<<endl;
						}
						   }break;
              default:
			     cout<<"输入错误请重新输入"<<endl;
				}
		}break;
	 case 2:{cout<<"t-输入老师的信息	k-查询老师信息	"<<endl;
		 char j;
	     cout<<"请输入t或k:"<<endl;
		 cin>>j;
		 switch(j)
		 {case 't':Set(2);break;
		 
		  case 'k':{ 
			              if(teacherNO!=0)
						  {
                               for(t=1;t<=teacherNO;t++)
							   { int num;
							  cout<<"请输入要查询的老师编号:";
						      cin>>num;
							  if (num==tt.number )
							  {cout<<"teacher的信息为:"<<endl;
							         tt.Getteacher1()  ; 
		                             tt.Getteacher2()  ;
							  }
							  else
								  cout<<"没有该老师!";  
							   }
						  }
                         else
						 {
	                       cout<<"there is no teacher's message"<<endl;
						 }
				   }break;
		  default:cout<<"输入错误请重新输入"<<endl;
		 }	 
		 }break;
  case 3:{cout<<"g-输入毕业学生的信息	b-查询毕业学生信息	 "<<endl;
		 char j;
	  cout<<"请输入g或b:"<<endl;
		 cin>>j;
		 switch(j)
			{	 case 'g':Set(3);break;
		         case 'b':{
		                     if(graduateNO!=0)
							 {
                                 for(t=1;t<=graduateNO;t++)
								 {
	                                  cout<<"graduate的信息为:"<<endl;
	                                  gg.Getgraduate1() ; 
		                              gg.Getgraduate2()  ;
								 }
							 }
                            else
							{
	                           cout<<"there is no graduate's message"<<endl;
							}
						}break;
			    default:	 cout<<"输入错误请重新输入"<<endl;
			}
		}break;
  case 4:{cout<<"z-输入助教的信息	c-查询助教信息	"<<endl;
		 char j;
	      cout<<"请输入z或c:"<<endl;
		 cin>>j;
		 switch(j)
		 {case 'z':	Set(4);break;
	
		  case 'c':{
		                if(TANO!=0)

						{
                            for(t=1;t<=TANO;t++)
							{
	                           cout<<"TA的信息为:"<<endl;
	                           TT.GetTA() ;
							}
						}
                       else
					   {
	                      cout<<"there is no TA's message"<<endl;
					   }
				   }break;
		  default:
			 cout<<"输入错误请重新输入"<<endl;
		 }
	 }break;
  }


	cout<<"你还要进行其他操作吗?是“Y”,否“N”:";
 
	cin>>ch;
}while(ch=='Y' ||ch=='y');
    if(ch=='N' ||ch=='n')
	{
		cout<<"任务结束,欢迎下次光临!"<<endl;
    	return 0;
	}
    else 
	{
		cout<<"Error!you must enter 'Y'or'N'"<<endl<<"请重新输入"<<endl;
		return 0;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -