Advertisement
Guest User

Pascal Project

a guest
Mar 5th, 2017
656
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 3.01 KB | None | 0 0
  1. {Name: The ballandra Hospital Software
  2.  Author: John Doe
  3.  Description: This program, accepts the names of patients, their wards, vat charges, and then
  4.  uses the following information to determine the overall and super total. These amounts that
  5.  have been calculated are then stored. The program also calculates the interest and discounts and then
  6.  prints the various totals of each in a suitable table format.
  7.  Date: 07/03/17}
  8.  
  9. program ballandra;
  10. Uses crt;
  11. const
  12.  vcharge=1000;
  13.  interrate=0.08
  14. var
  15.  name,ward:string;
  16.  expenseincur:real;
  17.  total:real;
  18.  discount:real;
  19.  interest:real;
  20.  wcharge:real;
  21.  cost:real;
  22.  overall:real;
  23. i,x,n:char;
  24.  key:char;
  25.  response:string;
  26.  patN:array[1..28}of string;
  27.  patW:array[1..29]of string;
  28.  patE:array[1..28]of real;
  29.  patD:array[1..28]of real;
  30.            pati:array[1..28]of real;
  31.  patT:array[1..28]of real;
  32. End
  33.  Begin
  34.   expenseincur:=0;
  35.   total:=0;
  36.   overall:=;
  37.   i:=0;
  38.   n:=0;
  39.   x:=0;
  40.   writeLn('*****THE TOBAGO BALLANDRA ACCOUNTING SOFTWARE 2014*****);
  41.  writeLn('-----Press Enter to Start Process-----');
  42.   readkey;
  43.   REPEAT
  44.   Clrscr;
  45.    write('Enter Patients Name:');
  46.    readln(name);
  47.    write('Enter expenses incurred:')
  48.    readln(expenseicur);
  49.    writeln('Ward menu:medical');
  50.    writeln('     surgical');
  51.    writeln('     outpatient');
  52.    writeln('     pediatrician');
  53.    writeln('     maternity');
  54.    write(Enter the correct ward from the menu:');
  55.     readln(ward);
  56.     if(ward='out patient')then
  57.      Wcharge:=300
  58.       else
  59.     if(ward='surgical')then
  60.      Wcharge:=300
  61.       else
  62.     if(ward='pediatrician')then
  63.      Wcharge:=260
  64.      else
  65.      if(ward='pediatrician')then
  66.      Wcharge:=725
  67.      else
  68.      writeln('WARD DOES NOT EXIST');
  69.      {End};
  70.      n:=n+1;
  71.       cost:=expenseincur+Wcharge;
  72.         if(cost>=vcharge)then
  73.         begin
  74.          discount:=cost*discrate;{to calculate the discount}
  75.          total:=cost-discount;
  76.          interest:=0;
  77.          end;
  78.          if(cost<vcharge)then
  79.          begin
  80.            interest:=cost*interrate;
  81.            total:=cost+interest;
  82.            discount:=0;
  83.            end;
  84.           overall:=overall+total;
  85.           patN[n]:name;
  86.           patW[n]:ward;
  87.           patE[n]:=expenseincur;
  88.           patI[n]:=interest;
  89.           patD[n]:discount;
  90.           patT[n]:=total;
  91.           wrtieLn('Do you have another record?:');
  92.           writeLn('Type yes to continue and stop to end');
  93.           readLn(response)
  94.          UNTIL(response='stop')or(n=28);
  95.         writeln('Name   Ward   Expenditure   Incurred   Discount   Interest   Total');
  96.         writreln('***************************************************************************************');
  97.                      for i:=1 to n do
  98.                        begin
  99.       writeLn(patN[i],'   ', patE[i]:3:2,'   ', patL[i]:3:2,'   ,'patT[i]:3:2);
  100.                        end;
  101.                   writeLn('Number of Patients:',n);
  102.                   writeln('Super Total:',overall:3:2);
  103.             readLn;
  104.            End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement