Hi there I have been asked to design a program that asks the user to enter 12 months rainfall figures then carry out some simple calculations. i.e maximum rainfall,average,minimum etc etc
Arrays, parameter passing and procedures have to be used.

Firstly how do you make the program accept both real and integer values?
Also what is parameter passing and how can it be incorparated?
Is there a good site to find out these things cos this programming module is quite baffling!!!

Pascal is pretty smart about typecasting between real and integer.

var
  i: integer;
  r: real;
begin
  write( 'Enter an integer> ' ); readln( i );
  write( 'Enter a float> ' ); readln( r );
  writeln( 'You entered ', i, ' and ', r:5:2, '.' );
  writeln( 'The sum is ', (i + r):5:2 )
end.

A good tutorial: Pascal Programming.

A good reference: Free Pascal Reference Guide.

Hope this helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.