arithmetic Mean [class 20091208/11]

Option Explicit
'Script written by onur yuce gun
'Script copyrighted by
'Script version Friday, December 11, 2009 10:21:04 AM

Call Main()
Sub Main()
	Dim integer1
	Dim integer2
	'get two numbers as user input
	integer1 = rhino.GetInteger ("enter the first integer")
	integer2 = rhino.GetInteger ("enter the second integer")
	Dim result
	'call the calcMean function
	result = calcMean(integer1,integer2)
	rhino.Print result
End Sub
'function below gets two numbers
'and RETURNS the arithmetic mean of these numbers
Function calcMean(num1,num2)
	Dim sum
	sum = num1 + num2
	calcMean = sum/2
End Function
Advertisement

~ by onuryucegun on 2009/12/12.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.