当前位置: 首页>>代码示例>>C++>>正文


C++ MENU::CHOICE_MENU方法代码示例

本文整理汇总了C++中MENU::CHOICE_MENU方法的典型用法代码示例。如果您正苦于以下问题:C++ MENU::CHOICE_MENU方法的具体用法?C++ MENU::CHOICE_MENU怎么用?C++ MENU::CHOICE_MENU使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MENU的用法示例。


在下文中一共展示了MENU::CHOICE_MENU方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DISPLAY

void CASSETTE :: DISPLAY(void)
{
	MENU menu ;
	char filename[13] ;
	strcpy(filename,menu.CHOICE_MENU()) ;
	if (!strcmpi(filename,"FAILED"))
		return ;
	char t1[10] ;
	int t2, cascode ;
	gotoxy(72,2) ;
	cout <<"<0>=EXIT" ;
	gotoxy(5,5) ;
	cout <<"Enter code of the Cassette  " ;
	gets(t1) ;
	t2 = atoi(t1) ;
	cascode = t2 ;
	if (cascode == 0)
		return ;
	clrscr() ;
	if (!FOUND_CODE(filename,cascode))
	{
		gotoxy(5,5) ;
		cout <<"\7Record not found" ;
		getch() ;
		return ;
	}
	LINES line ;
	line.BOX(2,1,79,25,218) ;
	DISPLAY_RECORD(filename,cascode) ;
	gotoxy(5,24) ;
	cout <<"Press any key to continue..." ;
	getch() ;
}
开发者ID:akreddysoft,项目名称:CollegeCode,代码行数:33,代码来源:PROJECT.CPP

示例2: LIST

void CASSETTE :: LIST(void)
{
	MENU menu ;
	char filename[13] ;
	strcpy(filename,menu.CHOICE_MENU()) ;
	if (!strcmpi(filename,"FAILED"))
		return ;
	DISPLAY_LIST(filename) ;
}
开发者ID:akreddysoft,项目名称:CollegeCode,代码行数:9,代码来源:PROJECT.CPP

示例3: DELETION

void CASSETTE :: DELETION(void)
{
	MENU menu ;
	char t1[10], ch, filename[13] ;
	int t2, cascode, valid ;
	strcpy(filename,menu.CHOICE_MENU()) ;
	if (!strcmpi(filename,"FAILED"))
		return ;
	do
	{
		valid = 1 ;
		do
		{
			clrscr() ;
			gotoxy(72,2) ;
			cout <<"<0>=EXIT" ;
			gotoxy(5,5) ;
			cout <<"Enter code of the Cassette or <ENTER> for help " ;
			gets(t1) ;
			t2 = atoi(t1) ;
			cascode = t2 ;
			if (cascode == 0 && strlen(t1) != 0)
				return ;
			if (strlen(t1) == 0)
				DISPLAY_LIST(filename) ;
		} while (strlen(t1) == 0) ;
		if (!FOUND_CODE(filename,cascode))
		{
			valid = 0 ;
			gotoxy(5,20) ;
			cout <<"\7Cassette code not found." ;
			getch() ;
		}
	} while (!valid) ;
	clrscr() ;
	gotoxy(72,1) ;
	cout <<"<0>=EXIT" ;
	DISPLAY_RECORD(filename,cascode) ;
	do
	{
		gotoxy(5,12) ; clreol() ;
		cout <<"Delete this Cassette Record (y/n) " ;
		ch = getche() ;
		ch = toupper(ch) ;
		if (ch == '0')
			return ;
	} while (ch != 'Y' && ch != 'N') ;
	if (ch == 'N')
		return ;
	DELETE_RECORD(filename,cascode) ;
	gotoxy(5,20) ;
	cout <<"\7Record Deleted" ;
	gotoxy(5,25) ;
	cout <<"Press any key to continue..." ;
	getch() ;
}
开发者ID:akreddysoft,项目名称:CollegeCode,代码行数:56,代码来源:PROJECT.CPP

示例4: MODIFICATION

void CASSETTE :: MODIFICATION(void)
{
	MENU menu ;
	char t1[10], ch, filename[13] ;
	int t2, cascode, valid ;
	strcpy(filename,menu.CHOICE_MENU()) ;
	if (!strcmpi(filename,"FAILED"))
		return ;
	do
	{
		valid = 1 ;
		do
		{
			clrscr() ;
			gotoxy(72,2) ;
			cout <<"<0>=EXIT" ;
			gotoxy(5,5) ;
			cout <<"Enter code of the Cassette or <ENTER> for help " ;
			gets(t1) ;
			t2 = atoi(t1) ;
			cascode = t2 ;
			if (cascode == 0 && strlen(t1) != 0)
				return ;
			if (strlen(t1) == 0)
				DISPLAY_LIST(filename) ;
		} while (strlen(t1) == 0) ;
		if (!FOUND_CODE(filename,cascode))
		{
			valid = 0 ;
			gotoxy(5,20) ;
			cout <<"\7Cassette code not found." ;
			getch() ;
		}
	} while (!valid) ;
	clrscr() ;
	gotoxy(72,1) ;
	cout <<"<0>=EXIT" ;
	DISPLAY_RECORD(filename,cascode) ;
	do
	{
		gotoxy(5,12) ; clreol() ;
		cout <<"Modify Cassette Name (y/n) " ;
		ch = getche() ;
		ch = toupper(ch) ;
		if (ch == '0')
			return ;
	} while (ch != 'Y' && ch != 'N') ;
	if (ch == 'N')
		return ;
	char casname[36] ;
	do
	{
		valid = 1 ;
		gotoxy(5,25) ; clreol() ;
		cout <<"ENTER NAME OF THE CASSETTE" ;
		gotoxy(5,15) ; clreol() ;
		cout <<"Name : " ;
		gets(casname) ;
		if (casname[0] == '0')
			return ;
		if (strlen(casname) < 1 || strlen(casname) > 35)
		{
			valid = 0 ;
			gotoxy(5,25) ; clreol() ;
			cout <<"\7Enter Correctly (Range: 1..35)" ;
			getch() ;
		}
	} while (!valid) ;
	gotoxy(5,25) ; clreol() ;
	do
	{
		gotoxy(5,17) ; clreol() ;
		cout <<"Do you want to save (y/n) " ;
		ch = getche() ;
		ch = toupper(ch) ;
		if (ch == '0')
			return ;
	} while (ch != 'Y' && ch != 'N') ;
	if (ch == 'N')
		return ;
	int recno ;
	recno = RECORDNO(filename,cascode) ;
	fstream file ;
	file.open(filename, ios::out | ios::ate) ;
	strcpy(name,casname) ;
	int location ;
	location = (recno-1) * sizeof(CASSETTE) ;
	file.seekp(location) ;
	file.write((char *) this, sizeof(CASSETTE)) ;
	file.close() ;
	gotoxy(5,20) ;
	cout <<"\7Record Modified" ;
	gotoxy(5,25) ;
	cout <<"Press any key to continue..." ;
	getch() ;
}
开发者ID:akreddysoft,项目名称:CollegeCode,代码行数:96,代码来源:PROJECT.CPP

示例5: ADDITION

void CASSETTE :: ADDITION(void)
{
	MENU menu ;
	char filename[13], casname[36], ch ;
	int cascode, valid ;
	do
	{
		strcpy(filename,menu.CHOICE_MENU()) ;
		if (!strcmpi(filename,"FAILED"))
			return ;
		cascode = LASTCODE(filename) + 1 ;
		LINES line ;
		line.BOX(10,6,71,21,219) ;
		line.LINE_HOR(11,70,10,196) ;
		gotoxy(72,1) ;
		cout <<"<0>=EXIT" ;
		gotoxy(27,8) ;
		cout <<"ADDITION OF NEW CASSETTES" ;
		gotoxy(20,12) ;
		cout <<"Code # " <<cascode ;
		do
		{
			valid = 1 ;
			gotoxy(5,25) ; clreol() ;
			cout <<"ENTER NAME OF THE CASSETTE" ;
			gotoxy(20,14) ;
			cout <<"                                                   " ;
			gotoxy(20,14) ;
			cout <<"Name : " ;
			gets(casname) ;
			if (casname[0] == '0')
				return ;
			if (strlen(casname) < 1 || strlen(casname) > 35)
			{
				valid = 0 ;
				gotoxy(5,25) ; clreol() ;
				cout <<"\7Enter Correctly (Range: 1..35)" ;
				getch() ;
			}
		} while (!valid) ;
		gotoxy(5,25) ; clreol() ;
		do
		{
			gotoxy(20,17) ;
			cout <<"                           " ;
			gotoxy(20,17) ;
			cout <<"Do you want to save (y/n) " ;
			ch = getche() ;
			ch = toupper(ch) ;
			if (ch == '0')
				return ;
		} while (ch != 'Y' && ch != 'N') ;
		if (ch == 'Y')
		{
			char casstatus='A' ;
			int  ccode=0 ;
			ADD_RECORD(filename,cascode,casname,casstatus,ccode) ;
			cascode++ ;
		}
		do
		{
			gotoxy(20,19) ;
			cout <<"                               " ;
			gotoxy(20,19) ;
			cout <<"Do you want to Add more (y/n) " ;
			ch = getche() ;
			ch = toupper(ch) ;
			if (ch == '0')
				return ;
		} while (ch != 'Y' && ch != 'N') ;
		if (ch == 'N')
			return ;
	} while (ch == 'Y') ;
}
开发者ID:akreddysoft,项目名称:CollegeCode,代码行数:74,代码来源:PROJECT.CPP

示例6: ISSUE

void ISSUE_RETURN :: ISSUE(void)
{
	MENU menu ;
	CUSTOMER cust ;
	CASSETTE cas ;
	char filename[13] ;
	strcpy(filename,menu.CHOICE_MENU()) ;
	if (!strcmpi(filename,"FAILED"))
		return ;
	char t1[10] ;
	int t2, cascode, valid ;
	do
	{
		valid = 1 ;
		do
		{
			clrscr() ;
			gotoxy(72,2) ;
			cout <<"<0>=EXIT" ;
			gotoxy(5,5) ;
			cout <<"Enter code of the Cassette or <ENTER> for help " ;
			gets(t1) ;
			t2 = atoi(t1) ;
			cascode = t2 ;
			if (cascode == 0 && strlen(t1) != 0)
				return ;
			if (strlen(t1) == 0)
				DISPLAY_LIST(filename) ;
		} while (strlen(t1) == 0) ;
		if (!CASSETTE::FOUND_CODE(filename,cascode))
		{
			valid = 0 ;
			gotoxy(5,20) ;
			cout <<"\7Cassette code not found. Kindly choose another." ;
			getch() ;
		}
		if (valid && ISSUED(filename,cascode))
		{
			valid = 0 ;
			gotoxy(5,20) ;
			cout <<"\7Cassette already issued. Kindly choose another." ;
			getch() ;
		}
	} while (!valid) ;
	clrscr() ;
	int ccode ;
	ccode = CUSTOMER::LASTCODE() + 1 ;
	char custname[26], custphone[10] ;
	int d1, m1, y1 ;
	struct date d;
	getdate(&d);
	d1 = d.da_day ;
	m1 = d.da_mon ;
	y1 = d.da_year ;
	gotoxy(5,2) ;
	cout <<"Date: " <<d1 <<"/" <<m1 <<"/" <<y1 ;
	gotoxy(72,2) ;
	cout <<"<0>=EXIT" ;
	CASSETTE::DISPLAY_RECORD(filename,cascode) ;
	gotoxy(5,10) ;
	cout <<"Customer Code # " <<ccode ;
	gotoxy(5,12) ;
	cout <<"Name   : " ;
	gotoxy(5,13) ;
	cout <<"Phone  : " ;
	do
	{
		valid = 1 ;
		gotoxy(5,25) ; clreol() ;
		cout <<"Enter the name of the Customer" ;
		gotoxy(14,12) ; clreol() ;
		gets(custname) ;
		strupr(custname) ;
		if (custname[0] == '0')
			return ;
		if (strlen(custname) < 1 || strlen(custname) > 25)
		{
			valid = 0 ;
			gotoxy(5,25) ; clreol() ;
			cout <<"\7Enter correctly (Range: 1..25)" ;
			getch() ;
		}
	} while (!valid) ;
	do
	{
		valid = 1 ;
		gotoxy(5,25) ; clreol() ;
		cout <<"Enter Phone no. of the Customer" ;
		gotoxy(14,13) ; clreol() ;
		gets(custphone) ;
		if (custphone[0] == '0')
			return ;
		if ((strlen(custphone) < 7 && strlen(custphone) > 0) || (strlen(custphone) > 9))
		{
			valid = 0 ;
			gotoxy(5,25) ; clreol() ;
			cout <<"\7Enter correctly" ;
			getch() ;
		}
	} while (!valid) ;
//.........这里部分代码省略.........
开发者ID:akreddysoft,项目名称:CollegeCode,代码行数:101,代码来源:PROJECT.CPP


注:本文中的MENU::CHOICE_MENU方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。