学生信息管理系统测试报告
1.引言
1.1 编写目的
本测试报告为学生信息管理系统项目的测试报告,目的在于测试总结以及分析测试结果,描述系统是否符合需求。学生信息管理系统是应用于学校学生信息的管理以及维护的软件。可以方便的管理学生信息,维护以及修改学生信息。
1.2 项目背景
随着高校学生数量的增多,信息复杂度增加,十分有必要通过学生信息管理系统来完成学生信息的管理,修改及维护。开发学生信息管理系统在当今高校是十分有必要的。
1.3 用户群
使用于学校。
1.4 基本定义
五类测试错误类型。
A 类:严重错误,包括以下各种错误:
⏹ 由于程序所引起的死机, 非法退出 ⏹ 死循环
⏹ 因错误操作导致的程序中断 ⏹ 功能错误 ⏹ 数据通讯错误
B 类:较严重错误,包括以下各种错误:
⏹ 程序错误
⏹ 程序接口错误
C 类:一般性错误,包括以下各种错误:
⏹ 操作界面错误(包括数据窗口内列名定义、含义是否一致) ⏹ 打印内容、格式错误 ⏹ 删除操作未给出提示 ⏹ 与日常生活不符
D 类:较小错误,包括以下各种错误:
⏹ 界面不规范
⏹ 辅助说明描述不清楚 ⏹ 错误操作未给用户提示
⏹ 提示窗口文字未采用行业术语
1.5 参考资料
[1]《编程思想》,机械工业出版社,2007
[2]《软件测试方法和技术(第二版)》, 清华大学出版社
2 测试概要
测试目的:
在于为执行测试提供用例,指导测试的实施,查找分析缺陷,评估测试质量并执行测试用例后,需要跟踪故障,以确保开发的产品适合需求。
测试声明:测试人员在软件开发过程中的任务: 1、寻找Bug ;
2、软件各种属性的组合程度良好; 2、避免软件开发过程中的缺陷; 3、衡量软件的品质; 4、关注用户的需求。
2.1 测试环境 2.1.1 软件硬件配置
2.1.1 运行界面
运行界面如下:
图2-1 系统开始界面
2.2 测试执行
此次测试严格按项目测试计划执行,按时完成了测试计划规定的测试对象的测试。
针对测试计划规定的测试策略,在测试执行中都有实现,在测试执行过程中,依据测试计划和测试用例,对系统进行了完整的测试。
2.3 测试用例
1. 增添模块功能测试:
主要测试学生信息能否按一定要求与格式正确输入。 流程图及测试用例:如下图。
(1)
(2)
3、修改模块功能测试:
测试能否正确的按要求修改学生信息并保存。
(3)
4、查找功能功能测试:
测试能否按照学生姓名或者学号正确的查找到学生信息。 流程图及测试用例:如下图。
5、排序模块功能测试:
测试能否根据学生学号正确排序。 测试用例:如下图。
6、其他功能及缺陷测试:
显示功能以及菜单显示功能还有系统退出功能。有的模块并不能很好的处理好用户随意格式的输入,并不能很好的友好显示错误。如增添模块的用例所示,程序陷入死循环。
2.4 .1功能性
A. 可以合理增添查询学生信息。 B. 可以删除学生信息。 C. 可以合理修改学生信息。 D. 可以查询到任意已录入学生信息。 E. 可以对已录入学生进行排序。 F. 可以输出显示学生信息。
2.4.2 易用性
程序界面提示友好丰富,可以很好的根据提示完成操作。
2.5 单元测试及其测试用例
Add 等价类划分
测试用例:2.123
3.\\\
测试用例:2.asd456456\
测试用例:2.asd
测试用例:2.man
测试用例:2.asdc 6 25 3.2014
4.[1**********]25 5.2014\6\24 7.1111 6 24 8.3333 6 24 10. 2014 0 1 11.2014 13 33 16.2014 1 0
17.2008 2 31 可以检查出错误 18.2013 2 29 可以检查出错误
19.2013 1 33 可以检查出错误 20. 2013 4 33 可以检查出错误
测试用例:wo
测试用例:wo
测试用例:wo
测试用例:2.aaaaaaaaaaa 可以检查出错误
3.aa
4.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
5.[1**********] 可以检查出错误
测试用例:123#123#123#
Delete 等价类划分
测试用例:2.3 可以检查出错误
3.a
测试用例:2.a 可以检查出错误
Modify 等价类划分
测试用例:2.3 可以检查出错误
3.a
Modify 等价类划分——name 或number
测试用例:2.123 可以检查出错误
测试用例:2.0 可以检查出错误 3.a
2.6 集成测试
2.6.1 集成测试概要
2.6.1.1 集成测试定义
此阶段测试基于单元测试的完成。主要目的检测系统是否达到需求对业务及数
检测需求是否存在不合理的标准及要求。
2.6. 2 集成测试实现
此阶段将前面的模块测试进行汇总由于大多数测试已经做过,汇总一起就只进行了
简单的测试看是否各模块之间有影响。
2.7 系统测试
2.7.1 系统测试概要
2.7.1.1 系统测试定义
用于核实用户与软件之间的交互。系统测试的目标是确保用户界面会通过测试对象的功能来为用户提供相应的访问或浏览功能。
2.7.1.2系统测试实现
主要通过功能测试实现。与综合测试相同。
3.改进建议
在整个系统测试执行期间,项目组开发人员能够提出的各种缺陷,在一定程度上较好地保证了测试执行的效率以及测试最终期限。但是在整个软件测试活动中还是暴露了一些问题,如,测试执行时间相对较少,测试通过标准要求较低;细节性错误较多,测试时对管理平台不够熟悉,使用时效率偏低;测试时对系统了解不够透彻,测试执行时存在理解偏差,导致提交无效缺陷。通小组的协力合作,学生信息管理系统如期完成并达到交付标准。
建议:需求提出方可以再使用该系统的基础上,继续搜集用户的使用需求反馈,并结合市场同类产品的优势,在今后的版本中不断补充并完善功能。
● 在项目开始的时候应该制定编码标准,需求变更标准,开发和测试人
员都严格按照标准进行,可以在后期减少因为开发,测试不一致而导
致的问题,同时也可以降低沟通成本。
● 发布版本的时候,正确布置测试环境,减少因为测试环境出现的无效
bug 。
● 开发人员解决bug 的时候,填写bug 原因以及解决方式,方便bug 的
跟踪。
● 开发人员在开发版本上发现bug ,可以通知测试人员,因为开发人员
发现的bug 很有可能在测试版本上出现,而测试人员和开发人员的思
路不同,有可能测试人员没有发现该bug ,而且,这样可以保证发现
的bug 都能够被跟踪。
4 测试结论
存在致命错误系统不合格,需要重新修改某些语句。下面从各方面说明系统存在的问题:
4.1 功能
系统正确的实现了用户对学生信息增、删、改、查和排序的需求,小巧便捷。
4.2 易用性
现有系统实现了如下易用性:
1. 输入方式可理解性
2. 输入限制的正确性
3.操作提示信息正确性,一致性,可理解性
4.输入限制提示信息的正确性,可理解性,一致性
5. 学生信息增、删、改、查及显示的易用性
现有系统存在如下易用性缺陷:
1. 界面排版不美观,尤其是显示学生信息时
2. 输入解释性说明不够详尽
4.3 可靠性
现有系统的可靠性控制不够严密,很多控制是通过用户输入,错误的输入有可能引起未知的错误,导致系统进入死循环。现有系统的容错性不高,如果系统出现错误,无返回值,系统易崩溃。此为严重错误。
4.4安全性
程序中输入一些特定序列可能引起死循环。
5 心得体会
通过本次测试学生信息管理系统项目,总结测试阶段的测试以及分析测试结果,基本预期完成了系统,软件测试的真正意义在于发现错误,而不在于验证软件是正确的,再严密的测试也不能完全发现软件当中的错误,要确保软件基本可用,要加强软件的响应的环节,还要增强软件的可移植性和兼容性,白盒测试来解决系统缓冲溢出,黑盒测试来解决用户交互的bug ,从而全方面的提高系统的可用性,健壮性,安全性,稳定性,通过小组成员的通力合作,基本完成了软件功能,但是软件中还存在很多问题,需要进一步完善提高,比如程序中很多函数的判断语句带有scanf()函数,当输入一系列特定的不合理数据时会使程序进入死循环。系统有待修改与完善。
6 附件(程序代码)
#include
#include
#include //include the prototype of exit()
#include
const int NUMLEN = 11 ;
const int NAMLEN = 20 ; // name length
const int PHOLEN = 12 ; // max length of phone number
const int MAILEN = 20 ; // mail length
// The following constants used in struct ADDRESS
const int PROLEN = 10 ; // province length
const int CITLEN = 25 ; // city length
const int COULEN = 25 ; // county length
const int VILLEN = 20 ; // village length
int count = 0 ; // actual number of people
int choice = 0 ; // user's choice used in the menu
struct BIRTHDAY // struct birthday
{
int year ;
int month ;
int day ;
} ;
struct ADDRESS // struct address
{
char province[PROLEN] ; // store province address
char city[CITLEN] ; // store city address
char county[COULEN] ; // store county address
char village[VILLEN] ; // store village address
} ;
struct STUDENT // struct student
{
char name[NAMLEN] ; // store name
char num[NUMLEN] ; // store school number
int age ;
char sex ;
struct BIRTHDAY bir ;
struct ADDRESS addr ;
char phonum[PHOLEN] ; //store phone number
char mail[MAILEN] ; // store e-mail address
} ;
struct STUDENT stu[100] ; // the number of student
void Add(void) ;
void Get_bir(void) ; // used in Add() to get birthday
bool check(struct BIRTHDAY bir) ; // used in Cet_bir() to check bir's validity
bool leap_year(int year) ; // used in check() to confirm whether it is a leap year
void Get_addr(void) ; // used in Add() to get address
void Get_phonum(void) ; // used in Add() to get phone number
void Get_mail(void) ; // used in Add() to get e-mail address
/////////////////////////////////////////////////////////////////
void search_name(void) ; // search by name
void search_num(void) ; // search by number (school number)
void Display(int i) ; // display the information of someone
void Search(void) ;
/////////////////////////////////////////////////////////////////
void Modify(void) ; // used to modify student's information
void change(int i) ; // used in Modify()
bool yes_or_no(void) ; // used in change()
void change_name(void) ; // change information used in search by name
void change_num(void) ; // change information used in search by number
bool confirm(void) ; // to acquire the user's confirm
void Name(int i) ; // modify name, the following all used in change()
void Num(int i) ; // ...
void Age(int i) ; // ...
void Sex(int i) ; // ...
void Bir(int i) ; // ...
void Addr(int i) ; // ...
void Phonum(int i) ; // ...
void Mail(int i) ; // ...
/////////////////////////////////////////////////////////////////
void Delete(void) ; // delete information
void delete_name(void) ; // delete by name
void delete_num(void) ; // delete by number
void del(int i) ;
////////////////////////////////////////////////////////////////
void Sort(void) ;
////////////////////////////////////////////////////////////////
void Menu(void) ;
int get_ch() ; // get user's directive
void Show(void) ;
int main(void)
{
int n ;
Show() ;
Menu() ;
while (1)
{
choice = get_ch() ;
switch (choice)
{
case 1:
Add() ;
break ;
case 2:
Delete() ;
break ;
case 3:
Modify() ;
break ;
case 4:
Search() ;
break ;
case 5:
for (n = 0; n
Display(n) ;
break ;
case 6:
Sort() ;
break ;
case 7:
Menu() ;
break ;
case 0:
exit(0) ;
default:
printf("Incorrect indirective!\n") ;
}
}
return 0 ;
}
void Add(void)
{
printf("Enter your name: ") ;
scanf("%s",stu[count].name) ;
getchar() ;
printf("Enter your school number: ") ;
while(!(scanf("%s",stu[count].num) && strlen(stu[count].num) == NUMLEN - 1)) printf("Enter your school number(ten digits),try again: ") ;
getchar() ;
printf("Enter your age: ") ;
while(!(scanf("%d",&stu[count].age) && stu[count].age >= 15 && stu[count].age
getchar() ;
printf("Enter your sex: ") ;
while(!(scanf("%c",&stu[count].sex) && (stu[count].sex == 'm' || stu[count].sex == 'f'))) printf("The sex is %c?\n",stu[count].sex) ;
getchar() ;
Get_bir() ; // get birthday
getchar() ;
Get_addr() ; // get address
Get_phonum() ; // get phone number
Get_mail() ;
count ++ ;
printf("Done!\n") ;
}
void Get_bir(void)
{
printf("Enter your birthday like this: 2015 6 24\n") ;
printf("Enter your birthday: ") ;
while(!(scanf("%d%d%d", &stu[count].bir.year, &stu[count].bir.month, &stu[count].bir.day) && check(stu[count].bir)))
{
Sleep(1000);
printf("Wrong !! Try again: ") ;
}
}
bool check (struct BIRTHDAY bir)
{
if (2 == bir.month)
if(leap_year(bir.year))
if(bir.day
return true ;
else
{
printf("%d year %d month has %d days?\n",bir.year,bir.month,bir.day) ;
printf(" 2 month has no more than 29 days even the year is a leap year!!\n") ;
return false ;
}
else if (bir.day
return true ;
else
{
printf("%d year is not a leap year, so 2 month shouldn't have more than 28
days\n") ;
return false ;
}
else if(bir.day > 31)
{
printf("Have you ever seen a month that has %d days?\n", bir.day) ;
return false ;
}
if(31 == bir.day)
if((bir.month = 8 && bir.month % 2 == 0)) return true ;
else
{
printf("%d month is not a solar month,so it shouldn't have more than 30 days.\n",bir.month) ;
return false ;
}
else
return true ;
}
bool leap_year(int year)
{
return ((0 == year%4 && year% 100 != 0) || (0 == year%400)) ? true : false ;
}
void Get_addr(void)
{
printf("Enter your province: ") ;
while(!scanf("%s",stu[count].addr.province))
printf("Something went wrong!! Try again: ") ;
getchar() ;
printf("Enter your city: ") ;
while(!scanf("%s",stu[count].addr.city))
printf("Something went wrong!! Try again: ") ;
getchar() ;
printf("Enter your county: ") ;
while(!scanf("%s",stu[count].addr.county))
printf("Something went wrong!! Try again: ") ;
getchar() ;
printf("Enter your village: ") ;
while(!scanf("%s",stu[count].addr.village))
printf("Something went wrong!! Try again: ") ;
getchar() ;
}
void Get_phonum(void)
{
printf("Enter phone number: ") ;
while(!(scanf("%s",stu[count].phonum) && (strlen(stu[count].phonum) == PHOLEN - 1 || strlen(stu[count].phonum) == PHOLEN - 5)))
printf("Wrong!! Try again: ") ;
getchar() ;
}
void Get_mail(void)
{
printf("Enter e-mail address: ") ;
while(!scanf("%s",stu[count].mail))
printf("Wrong!! Try again: ") ;
getchar() ;
}
void Search(void)
{
if(!count)
printf("No person!! Please add first.\n") ;
else
{
int choice_12 = 0 ;
printf("Search by name, input 1(one); by number, input 2\n") ;
printf("Enter your choice: ") ;
while(!(scanf("%d",&choice_12) && (1 == choice_12 || 2 == choice_12)))
printf("Enter 1 or 2, Try again: ") ;
switch(choice_12)
{
case 1:
search_name() ;
break ;
case 2:
search_num() ;
break ;
}
}
}
void search_name(void)
{
char temp[NAMLEN] ;
printf("Enter the name: ") ;
while(scanf("%s",temp))
{
int flag = 0 ;
for (int i = 0; i
if (0 == strcmp(temp,(stu+i)->name))
{
Display(i) ;
flag = 1 ;
break ;
}
if (!flag)
{
printf("No such student!!\n") ;
printf("Enter the name carefully: ") ;
continue ;
}
if (flag)
break ;
}
}
void search_num(void)
{
char temp[NUMLEN] ;
printf("Enter the number: ") ;
while(scanf("%s",temp))
{
int flag = 0 ;
for (int i = 0; i
if (0 == strcmp(temp,(stu+i)->num))
{
Display(i) ;
flag = 1 ;
break ;
}
if (!flag)
{
printf("No such person!!\n") ;
printf("Enter the number carefully: ") ;
continue ;
}
if (flag)
break ;
}
}
void Display(int i)
{
printf("name \tnumber\tage sex\n") ;
printf("%s \t%s\t%d %c\n",stu[i].name,stu[i].num,stu[i].age,stu[i].sex) ;
printf("birthday: %d %d %d\n",stu[i].bir.year,stu[i].bir.month,stu[i].bir.day) ;
printf("address: %s %s %s %s\n",stu[i].addr.province,stu[i].addr.city,stu[i].addr.county,stu
[i].addr.village) ;
printf("phone number: %s\te-mail address: %s\n",stu[i].phonum,stu[i].mail) ;
}
///////////////////////////////////////////////////////////
void Modify(void)
{
if (!count)
printf("No person!! please add first.\n") ;
else
{
int choice_12 = 0 ;
printf("Search by name, input 1; by number, input 2\n") ;
printf("Enter your choice now: ") ;
while (!(scanf("%d",&choice_12) && (1 == choice_12 || 2 == choice_12))) printf("Enter 1 or 2. Try again: ") ;
switch (choice_12)
{
case 1:
change_name() ;
break ;
case 2:
change_num() ;
break ;
}
}
}
void change(int i)
{
printf("1) name \t2) number \t3) age \t4) sex\n") ;
printf("5) birthfay \t6) address\t7) phonum\t8) e-mail\n") ;
int choice_18 = 0 ;
bool FLAG = true ;
while(FLAG)
{
printf("Enter the corresponding option: ") ;
while(!(scanf("%d",&choice_18) && choice_18 0))
printf("Enter 1 or 2 or ... or 8. Try again: ") ;
switch (choice_18)
{
case 1:
Name(i) ;
FLAG = yes_or_no() ;
break ;
case 2:
Num(i) ;
FLAG = yes_or_no() ;
break ;
case 3:
Age(i) ;
FLAG = yes_or_no() ;
break ;
case 4:
Sex(i) ;
FLAG = yes_or_no() ;
break ;
case 5:
Bir(i) ;
FLAG = yes_or_no() ;
break ;
case 6:
Addr(i) ;
FLAG = yes_or_no() ;
break ;
case 7:
Phonum(i) ;
FLAG = yes_or_no() ;
break ;
case 8:
Mail(i) ;
FLAG = yes_or_no() ;
break ;
}
}
}
bool yes_or_no(void)
{
getchar() ;
char flag = '0' ;
printf("Continue ?(y\\n): ") ;
while(!(scanf("%c",&flag) && ('y' == flag || 'Y' == flag || 'n' == flag || 'N' == flag))) printf("Enter 'y'('Y') or 'n'('N'). Try again: ") ;
if ('y' == flag || 'Y' == flag)
return true ;
else
return false ;
}
void change_name(void)
{
char temp[NAMLEN] ;
printf("Enter the name: ") ;
while(scanf("%s",temp))
{
int flag = 0 ;
for (int i = 0; i
if (0 == strcmp(temp,(stu+i)->name))
{
change(i) ;
flag = 1 ;
break ;
}
if (!flag)
{
printf("No such student!!\n") ;
printf("Enter the name carefully: ") ;
continue ;
}
else
break ;
}
}
void change_num(void)
{
char temp[NUMLEN] ;
printf("Enter the number: ") ;
while (scanf("%s",temp))
{
int flag = 0 ;
for (int i = 0; i
if (0 == strcmp(temp,(stu+i)->num))
{
change(i) ;
flag = 1 ;
break ;
}
if (!flag)
{
printf("No such person!!\n") ;
printf("Enter the number carefully: ") ;
continue ;
}
else
break ;
}
}
void Name(int i)
{
char temp_name[NAMLEN] ;
while(!scanf("%s",temp_name))
printf("Enter carefully! Try again: ") ;
getchar() ;
if (confirm())
{
strcpy(stu[i].name,temp_name) ;
printf("Update successfully!\n") ;
}
else
printf("Information remains unchanged!\n") ;
}
void Num(int i)
{
char temp_num[NUMLEN] ;
while(!(scanf("%s",temp_num) && 10 == strlen(temp_num)))
printf("Enter carefully! Try again: ") ;
getchar() ;
if (confirm())
{
strcpy(stu[i].num,temp_num) ;
printf("Update successfully!\n") ;
}
else
printf("Information remains unchanged!\n") ;
}
void Age(int i)
{
int temp_age = 0 ;
while(!(scanf("%d",&temp_age) && temp_age 14))
printf("Age ranges from 15 to 30. Try again: ") ;
getchar() ;
if(confirm())
{
stu[i].age = temp_age ;
printf("Update successfully!\n") ;
}
else
printf("Information remains unchanged!\n") ;
}
void Sex(int i)
{
char temp_sex = '0' ;
while(!(scanf("%c",&temp_sex) && ('m' == temp_sex || 'f' == temp_sex)))
printf("Enter 'm' or 'f'. Try again: ") ;
getchar() ;
if(confirm())
{
stu[i].sex = temp_sex ;
printf("Update successfully!\n") ;
}
else
printf("Information remains unchanged!\n") ;
}
void Bir(int i)
{
struct BIRTHDAY temp_bir ;
printf("Enter the birthday like this: 2048 8 15\n") ;
printf("Enter the birthday now: ") ;
while(!(scanf("%d %d %d", &temp_bir.year, &temp_bir.month, &temp_bir.day) && check(temp_bir)))
printf("Enter carefully. Try again: ") ;
getchar() ;
if(confirm())
{
// the below three statements can be substituted with stu[i].bir = temp_bir stu[i].bir.year = temp_bir.year ;
stu[i].bir.month = temp_bir.month ;
stu[i].bir.day = temp_bir.day ;
printf("Update successfully!\n") ;
}
else
printf("Information remains unchanged!\n") ;
}
void Addr(int i)
{
struct ADDRESS temp_addr ;
printf("Enter the address like this: henan zhengzhou hongxing zhaozhuang\n") ;
printf("Enter the new address now: ") ;
while(!scanf("%s %s %s %s",temp_addr.province, temp_addr.city, temp_addr.county, temp_addr.village))
printf("Enter carefully. Try again: ") ;
getchar() ;
if(confirm())
{
// the below four statements can be substituted with stu[i].addr = temp_addr strcpy(stu[i].addr.province,temp_addr.province) ;
strcpy(stu[i].addr.city,temp_addr.city) ;
strcpy(stu[i].addr.county,temp_addr.county) ;
strcpy(stu[i].addr.village,temp_addr.village) ;
printf("Update successfully!\n") ;
}
else
printf("Information remains unchanged!\n") ;
}
void Phonum(int i)
{
char temp_phonum[PHOLEN] ;
printf("Enter the new phone number now: ") ;
while(!(scanf("%s",temp_phonum) && (7 == strlen(temp_phonum) || 11 == strlen(temp_phonum))))
printf("Enter carefully. Try again: ") ;
getchar() ;
if(confirm())
{
strcpy(stu[i].phonum,temp_phonum) ;
printf("Update successfully!\n") ;
}
else
printf("Information remains unchanged!\n") ;
}
void Mail(int i)
{
char temp_mail[MAILEN] ;
printf("Enter the new e-mail address: ") ;
while(!scanf("%s",temp_mail))
printf("Enter carefully. Try again: ") ;
getchar() ;
if(confirm())
{
strcpy(stu[i].mail,temp_mail) ;
printf("Update successfully!\n") ;
}
else
printf("Information remains unchanged.\n") ;
}
bool confirm(void)
{
char flags = '0' ;
printf("Do you really want to change that ?(y\\n): ") ;
while (!(scanf("%c",&flags) && ('y' == flags || 'Y' == flags || 'n' == flags || 'N' == flags))) printf("Enter 'y'('Y') or 'n'('N'). Try again: ") ;
if ('y' == flags || 'Y' == flags)
return true ;
else
return false ;
}
//////////////////////////////////////////////
void Delete(void)
{
if (!count)
printf("No person!! Please add first.\n") ;
else
{
int choice_12 = 0 ;
printf("Search by name, input 1; by number, input 2\n") ;
printf("Enter your choice now: ") ;
while(!(scanf("%d",&choice_12) && (1 == choice_12 || 2 == choice_12))) printf("Enter 1 or 2. Try again: ") ;
switch (choice_12)
{
case 1:
delete_name() ;
break ;
case 2:
delete_num() ;
break ;
}
}
}
void del(int i)
{
if (confirm())
{
for (int j = i; j
stu[j] = stu[j+1] ;
-- count ; // important
printf("Delete successfully!\n") ;
}
else
printf("Information remains unchanged!\n") ;
}
void delete_name(void)
{
char temp[NAMLEN] ;
printf("Enter the name: ") ;
while(scanf("%s",temp))
{
int flag = 0 ;
for (int i = 0; i
if (0 == strcmp(temp,(stu+i)->name))
{
del(i) ;
flag = 1 ;
break ;
}
if (!flag)
{
printf("No such student!!\n") ;
printf("Enter the name carefully: ") ;
continue ;
}
else
break ;
}
}
void delete_num(void)
{
char temp[NUMLEN] ;
printf("Enter the number: ") ;
while (scanf("%s",temp))
{
int flag = 0 ;
for (int i = 0; i
if (0 == strcmp(temp,(stu+i)->num))
{
del(i) ;
flag = 1 ;
break ;
}
if (!flag)
{
printf("No such person!!\n") ;
printf("Enter the number carefully: ") ;
continue ;
}
else
break ;
}
}
//////////////////////////////////////////////
void Sort(void)
{
if(!count)
printf("No person!! please add first.\n") ;
else
{
struct STUDENT temp_stu ;
for (int i = 0; i
for (int j = i; j
if (strcmp(stu[i].num,stu[j].num) >= 0)
{
temp_stu = stu[i] ;
stu[i] = stu[j] ;
stu[j] = temp_stu ;
}
printf("Sort successfully.\n") ;
}
}
void Menu(void)
{
printf("\t\t 1) Add 2) Delete 3) Modify printf("\t\t 5) Output 6) Sort 7) Menu
}
4) Search\n") ; 0) Exit\n") ;
int get_ch()
{
int choi(0) ;
printf("Enter your choice: ") ;
while (!(scanf("%d",&choi) != EOF && choi >= 0 && choi
}
void Show(void)
{
printf("\t\t\t|||||||||||||||||||||||||||||||||\n") ;
printf("\t\t\t|| ||\n") ;
printf("\t\t\t|| WELCOME TO COME HERE ||\n") ; printf("\t\t\t|| ||\n") ;
printf("\t\t\t|||||||||||||||||||||||||||||||||\n\n") ;
}