📄 expense.bak
字号:
#include<stdio.h>
#include<conio.h>
typedef struct EXPENSE
{
char cid[10];
int no;
float lchrg,tchrg;
};
void exchrg(char id)
{
FILE *exptr,*cin;
EXPENSE ex;
CUST c;
float amt;
char cid[10];
int recf=0;
cin=fopen("c:\\hotel\\database\\checkin.dat","rb");
exptr=fopen("c:\\hotel\\database\\Expense.dat","ab+");
clrscr();
panel();
statusbar("Please Enter Customer ID");
textcolor(YELLOW);
gotoxy(10,6);
cprintf("Enter The Customer ID :-> ");
scanf("%s",cid);
while(fread(&c,sizeof(c),1,cin)==1)
{
if(strcmpi(cid,c.cid)==0)
{
recf=1;
break;
}
}
if(recf==0)
{
statusbar("Customer Not Checked In . . .");
getch();
return;
}
gotoxy(10,8);
cprintf("Customer Name :-> ");
printf("%s",c.name);
gotoxy(45,8);
cprintf("Room No. :->");
printf("%d",c.rno);
strcpy(ex.cid,cid);
ex.no=c.rno;
ex.lchrg=0.0;
ex.tchrg=0.0;
gotoxy(10,12);
statusbar("Please Enter the Amount");
cprintf("Enter the amount ");
gotoxy(30,12);
scanf("%f",&amt);
if(id=='l')
{
statusbar("Enter the laundry Charge");
ex.lchrg+=amt;
}
else
{
statusbar("Enter the laundry Charge");
ex.tchrg+=amt;
}
fwrite(&ex,sizeof(ex),1,exptr);
fclose(exptr);
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -