Write an app that reads the integers representing the total sales for three sales people then determines ad prints the largest and the smallest integers in the group.
Module Module1
Sub Main()
Dim totalSale As Double = -1
Dim largest As Double = Double.MinValue
Dim smallest As Double = Double.MaxValue
'reads the integers representing the total sales for three sales people
For i As Integer = 0 To 2
Console.Write("Enter the total sales for sale person {0}: ", (i + 1))
Double.TryParse(Console.ReadLine(), totalSale)
If totalSale < smallest Then
smallest = totalSale
End If
If totalSale > largest Then
largest = totalSale
End If
Next
Console.WriteLine(vbNewLine + "The largest integer in the group is: {0}", largest)
Console.WriteLine("The smallest integer in the group is: {0}", smallest)
Console.ReadLine()
End Sub
End Module
Comments
Leave a comment