We help IT Professionals succeed at work.
Get Started

how do u solve this problem

Dr anonymous
Dr anonymous asked
on
501 Views
Last Modified: 2018-03-13
I had this question after viewing Pascal Helo.

i had this script
unit hospital;
interface

implementation
uses crt;
Var
name:string;
typeofroom,tp,tv,nory1,nory2:char;
month, day, year, daysstayed,roomcharge,tpcharge,tvcharge,totalcharge:integer;

const
pc=125;
sc=95;
Wc=75;
Tvc=3.50;
Tpc=1.75;
begin
//prompting
writeln('please enter the patients''s name':44);
readln(name);
writeln('please enter the number of days stayed in the hospital':63);
readln(daysstayed);
writeln('please write the month':31);
readln(month);
writeln('please write the day':29);
readln(day);
writeln('pelase enter the year':30);
readln(year);
writeln('please enter y or n for which typeofroom you used. P for private, S for semi private, and W for ward':57);
readln(typeofroom);
Case typeofroom of 'P':roomcharge:=(pc*daysstayed);
                   's':roomcharge:=(sc*daysstayed);
                   'w':roomcharge:=(wc*daysstayed);
end;
writeln('enter y or n for yes or no if they used the telephone':62);
readln(nory1);
Case nory1 of 'Y':tpcharge:=(tpc*daysstayed);
                 'N':tpcharge:=0;
end;

writeln('enter y or n for yes or no if they used the television':63);
readln(nory2);
Case nory2 of 'Y':tvcharge:=Tvc*daysstayed;
                 'N':tvcharge:=0;
end;
//computing
Totalcharge:=roomcharge+tvcharge+tpcharge;


end.
and the error Error: Incompatible types: got "S80REAL" expected "LONGINT"
2 times
plz help me fix it
thanx
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 8 Answers and 14 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE