Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {Name: The ballandra Hospital Software
- Author: John Doe
- Description: This program, accepts the names of patients, their wards, vat charges, and then
- uses the following information to determine the overall and super total. These amounts that
- have been calculated are then stored. The program also calculates the interest and discounts and then
- prints the various totals of each in a suitable table format.
- Date: 07/03/17}
- program ballandra;
- Uses crt;
- const
- vcharge=1000;
- interrate=0.08
- var
- name,ward:string;
- expenseincur:real;
- total:real;
- discount:real;
- interest:real;
- wcharge:real;
- cost:real;
- overall:real;
- i,x,n:char;
- key:char;
- response:string;
- patN:array[1..28}of string;
- patW:array[1..29]of string;
- patE:array[1..28]of real;
- patD:array[1..28]of real;
- pati:array[1..28]of real;
- patT:array[1..28]of real;
- End
- Begin
- expenseincur:=0;
- total:=0;
- overall:=;
- i:=0;
- n:=0;
- x:=0;
- writeLn('*****THE TOBAGO BALLANDRA ACCOUNTING SOFTWARE 2014*****);
- writeLn('-----Press Enter to Start Process-----');
- readkey;
- REPEAT
- Clrscr;
- write('Enter Patients Name:');
- readln(name);
- write('Enter expenses incurred:')
- readln(expenseicur);
- writeln('Ward menu:medical');
- writeln(' surgical');
- writeln(' outpatient');
- writeln(' pediatrician');
- writeln(' maternity');
- write(Enter the correct ward from the menu:');
- readln(ward);
- if(ward='out patient')then
- Wcharge:=300
- else
- if(ward='surgical')then
- Wcharge:=300
- else
- if(ward='pediatrician')then
- Wcharge:=260
- else
- if(ward='pediatrician')then
- Wcharge:=725
- else
- writeln('WARD DOES NOT EXIST');
- {End};
- n:=n+1;
- cost:=expenseincur+Wcharge;
- if(cost>=vcharge)then
- begin
- discount:=cost*discrate;{to calculate the discount}
- total:=cost-discount;
- interest:=0;
- end;
- if(cost<vcharge)then
- begin
- interest:=cost*interrate;
- total:=cost+interest;
- discount:=0;
- end;
- overall:=overall+total;
- patN[n]:name;
- patW[n]:ward;
- patE[n]:=expenseincur;
- patI[n]:=interest;
- patD[n]:discount;
- patT[n]:=total;
- wrtieLn('Do you have another record?:');
- writeLn('Type yes to continue and stop to end');
- readLn(response)
- UNTIL(response='stop')or(n=28);
- writeln('Name Ward Expenditure Incurred Discount Interest Total');
- writreln('***************************************************************************************');
- for i:=1 to n do
- begin
- writeLn(patN[i],' ', patE[i]:3:2,' ', patL[i]:3:2,' ,'patT[i]:3:2);
- end;
- writeLn('Number of Patients:',n);
- writeln('Super Total:',overall:3:2);
- readLn;
- End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement