Answer to Question #217233 in Visual Basic for Vee

Question #217233

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.


1
Expert's answer
2021-07-15T00:11:33-0400
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





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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS