954,541 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Assignment Help!!!!!

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!!!

mactas
Newbie Poster
1 post since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

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.

Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You