悠悠同学网www.uuclass.com
gets(name); strupr(name); if(strlen(name) > 19 || strlen(name) == 0) { valid = 0; sound(500); delay(100); nosound(); gotoxy(1,25); clreol(); gotoxy(1,24); cout<<\SHOULD NOT BE BLANK OR GREATER THAN 19 \ gotoxy(1,25); cout<<\any key to continue ... \ getch(); gotoxy(1,24); clreol(); gotoxy(1,25); clreol(); gotoxy(13,16); clreol(); } } gotoxy(1,25); clreol(); gotoxy(13,17); cout<<\(y/n) : \ do { valid = 1; gotoxy(28,17); ch = getche(); ch = toupper(ch); if(ch != 'Y' && ch != 'N') { valid = 0; sound(500); delay(100); nosound(); gotoxy(28,17); clreol(); } }while(!valid); valid = 0; while ( !valid && ch == 'Y') { modified = 1; valid = 1; gotoxy(13,17); clreol(); gotoxy(3,25); 悠悠同学网www.uuclass.com
cout<<\THE ROOM NO. OF THE CUSTOMER, FOR BLANK\ gotoxy(13,17); gets(roomno); if (strlen(roomno) == 0) strcpy(roomno,\ } gotoxy(1,25); clreol(); gotoxy(13,18); cout<<\(y/n) : \ do { valid = 1; gotoxy(28,18); ch = getche(); ch = toupper(ch); if(ch != 'Y' && ch != 'N') { valid = 0; sound(500); delay(100); nosound(); gotoxy(28,18); clreol(); } }while(!valid); valid = 0; while(!valid && ch == 'Y') { modified = 1; valid = 1; gotoxy(13,21); clreol(); gotoxy(3,21); cout<<\THE ORDER OF THE CUSTOMER, FOR BLANK\ gotoxy(13,18);clreol(); gets(order); if(strlen(order) >99 || strlen(order) == 0) { valid = 0; sound(500); delay(100); nosound(); gotoxy(1,25); clreol(); gotoxy(1,24); cout<<\NOT BE BLANK OF GREATER THAN 99\悠悠同学网www.uuclass.com gotoxy(1,25); cout<<\any key to continue... \ getch(); gotoxy(1,24); clreol(); gotoxy(1,25); clreol(); gotoxy(13,21); clreol(); } } if(! modified) return; gotoxy(1,25); clreol(); cout<<\you want to save the record (y/n) : \ do { valid = 1; gotoxy(41,23); ch = getche(); ch = toupper(ch); if(ch != 'Y' && ch != 'N') { valid = 0; sound(500); delay(100); nosound(); gotoxy(41,23); clreol(); } }while( !valid); if (ch == 'N') return; fstream file; file.open(\ios :: binary | ios: int recno; recno = t_code; int location; location = (recno -1) * sizeof(hkeep); file.seekp(location); file.write((char*) this, sizeof(hkeep)); file.close(); clrscr(); sound(500); delay(100); nosound(); gotoxy(1,14); ut | ios::ate); 悠悠同学网www.uuclass.com cout<<\modified \ m.line_hor(1,79,24,196); gotoxy(1,25); cout<<\any key to continue...\ getch(); } //***************************************************************** // CLASS NAME : HKEEP // FUNTION NAME : MODIFY // DETAILS : IT TAKES THE ORDER SERIAL NO. TO MODIFY THE // RECORD IN SYSTEM'S FILE //***************************************************************** void hkeep :: modify(void) { menu m; clrscr(); int valid; int t_code = 0,t; char t1_code[5], t2_code[5]; char ch; gotoxy(3,3); cout<<\Enter the Order Serial No. of the record to be modified : \ gotoxy(3,4); cout<<\or Press to see form the list or '0' to exit : \ gets(t1_code); t = atoi(t1_code); t_code = t; if(t1_code[0] == '0') return; if(t1_code[0] != '\\0') { clrscr(); if(!found_record(t_code)) { sound(500); delay(100); nosound(); gotoxy(3,15); cout<<\not found\ m.line_hor(1,79,24,196); gotoxy(1,25); cout<<\any key to continue ... \ getch(); 悠悠同学网www.uuclass.com
return; } display_record(t_code); gotoxy(3,12); cout<<\you want to modify this record (y/n) : \ do { valid =1 ; gotoxy(45,12); ch = getche(); ch = toupper(ch); if(ch != 'Y' && ch != 'N') { valid = 0; sound(500); delay(100); nosound(); gotoxy(45,12); clreol(); } }while(! valid); if( ch == 'N') return; modify_record(t_code); return; } display_list(); gotoxy(1,25); clreol(); gotoxy(3,25); cout<<\Order Serial No. of the record or to exit : \ gets(t2_code); t = atoi(t2_code); t_code = t; if(t2_code[0] == '0') return; if(t2_code[0] != '\\0') clrscr(); if(!found_record(t_code)) { sound(500); delay(100); nosound(); gotoxy(3,15); cout<<\not found\