I'm killing two birds with one stone and revising my Physics by writing a Pascal program:
program ProjMotion(Input, Output);
var speed, angle, InitVel, Grav, Time: real;
begin;
writeln('Hello. This is a program to calculate the time a ball takes to hit the ground. Air resistance is negligble.');
writeln('Please input the speed at which the ball is struck:');
readln( speed );
writeln('Now please input the angle at which the ball travelled at:');
readln( angle );
InitVel := speed * cos(speed);
writeln('This means the inital velocity is', InitVel,'.');
writeln('Please input gravity (The standard measurement of gravity is 9.81):');
readln ( Grav );
writeln('The equation of time in this instance is Time = Velocity - Initial Velocity / Acceleration.');
writeln('In other words Time is equal to', speed,' - ', InitVel,' /', Grav, '.');
Time := speed - InitVel / Grav;
writeln('Therfore time is equal to', Time, '!');
end.
The idea of the code is to find the time taken for a ball to hit the ground. My problem is when an equation is solved it is outputted as standard form (I.E -2.9E+001) and I can't figure out how to solve this problem.
Any ideas?