90 307
Assignments Done
99.3%
Successfully Done
In September 2020

# Answer to Question #3786 in Visual Basic for BoB

Question #3786
Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and the display the following data:

&bull; The lowest number in the array
&bull; The highest number in the array
&bull; The total of the numbers in the array
&bull; The average of the numbers in the array
1
2011-08-01T15:43:28-0400
Module Module1
Private array(20) As Integer

Sub Main()
& Console.WriteLine("Enter 20 numbers:")
& For i As Integer = 0 To 19
& Next
& Console.WriteLine("The lowest number in the array: " + Lowestnumberinthearray().ToString())
& Console.WriteLine("The highest number in the array: " + Highestnumberinthearray().ToString())
& Console.WriteLine("The total of the numbers in the array: " + Totalofthenumbers().ToString())
& Console.WriteLine("The average of the numbers in the array: " + Averageofthenumbers().ToString())
End Sub
& #039;'' <summary>
& #039;'' Find the highest number in the array
& #039;'' </summary>
& #039;'' <returns></returns>
& #039;'' <remarks></remarks>
Private Function Highestnumberinthearray()
& Dim low As Integer = array(0)
& For i As Integer = 0 To 19
If low < array(i) Then
low = array(i)
End If
& Next
& Return low
End Function
& #039;'' <summary>
& #039;'' Find the lowest number in the array
& #039;'' </summary>
& #039;'' <returns></returns>
& #039;'' <remarks></remarks>
Private Function Lowestnumberinthearray()
& Dim low As Integer = array(0)
& For i As Integer = 0 To 19
If low > array(i) Then
low = array(i)
End If
& Next
& Return low
End Function
& #039;'' <summary>
& #039;'' Total
& #039;'' </summary>
& #039;'' <returns></returns>
& #039;'' <remarks></remarks>
Private Function Totalofthenumbers()
& Dim totalnumber As Integer = 0
& For i As Integer = 0 To 19
totalnumber += array(i)
& Next
End Function
& #039;'' <summary>
& #039;'' Avarage
& #039;'' </summary>
& #039;'' <returns></returns>
& #039;'' <remarks></remarks>
Private Function Averageofthenumbers()
& Dim Averagenumber As Integer = 0
& For i As Integer = 0 To 19
Averagenumber += array(i)
& Next
& Return Averagenumber / 20
End Function
End Module

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!