How do I write arrays in pascal? -
is program correctly written array?
program malaria_outbreak (input,output); var bc:real; lo:real; count:integer; num:integer; bloodtest:integer; registration:integer; clinic:string; doctorfee:integer; total:integer; nmb_payable:real; company:string; name:string; patient:array[1..10] of string begin clrscr; bc:=(0.8); lo:=(0.7); count:=(0); num:=(0); bloodtest:=(num * 700); registration:=(500); writeln('please enter name of patient'); readln(name); while (name <> 'end')do begin count:= 1 10 begin writeln('please enter clinic patient attends'); readln(clinic); if (clinic = 'type 1') begin doctorfee:=(800); end; if (clinic = 'type 2') begin doctorfee:=(1200); end; writeln('the doctor fee patient $',doctorfee); writeln('please enter number of blood tests patient has had'); readln(num); bloodtest:=(num * bloodtest); writeln('the blood test patient $',bloodtest); tmb:=(registration + doctorfee + bloodtest); writeln('the total medical bill patient $',tmb); writeln('please enter insurance company clinic affiliated with'); readln(company); if (company = 'blue cross') begin nmb_payable:=(bc * tmb); end; if (company = 'loj') begin nmb_payable:=(lo * tmb); end; writeln('the net medical bill patient $',nmb_payable); end; readln; readln; end
looks good, might want include ;
after datatype (string
)
patient : array[1..10] of string;
Comments
Post a Comment