Solved

# A litle problem not so big...

Posted on 2003-02-23

I want to make a program thet will calculate the theard variable thet is not inputed like a number but like ?.

If you can think of a nother way to do this write it.

program speed;

type m1= array ['?'..'?'] of char;

m2=array ['?'..'?'] of char;

m3=array ['?'..'?'] of char;

var s:array [m1] of real;

t: array [m2] of real;

v: array [m3] of real;

begin repeat

wrtite ('input varables if, no var. then input ?);

writeln (' input speed v=');

readln (v);

writeln ('input the distanse s=');

readln (s);

writeln('input time in seconds t=');

readln (t);

until ((v=?) and (s>=0) and (t>=0)) or ((v>=0) and (S=?) and (t>=0)) or ((v>=0) and (s>=0) and (t=?));

if v=? then

begin

v:=s/t;

writeln('speed is v=',v:0:2);

end;

if v=0 then writeln( 'pa nisi se pomako');

if s=? then

begin

s:=v*t;

writeln('distanse is s=', s:0:2);

end;

if s=0 then writel ('prijedeni put je 0');

if t=? then

begin

t:=s/v;

writeln (' vrijeme je t=',t:0:2);

end;

readln

end.