Answer to Question #314006 in Visual Basic for Michael Sampson

Question #314006

Students in the BIT level 300 class optained various grades in a Mid sem exam. A computer program is needed to find the highest and lowest class score. Write down the input and output to solve the above problem


1
Expert's answer
2022-03-18T12:13:21-0400


Imports System.IO


Module Module1
   
    Sub Main()
        Console.Write("Enter the number of students: ")
        Dim numberStudents As Integer = Integer.Parse(Console.ReadLine())
        Dim highest As Integer = Integer.MinValue
        Dim lowest As Integer = Integer.MaxValue
        For i As Integer = 0 To numberStudents - 1
            Console.Write("Enter grade a Mid sem exam: ")
            Dim grade As Integer = Integer.Parse(Console.ReadLine())
            If (grade > highest) Then
                highest = grade
            End If


            If (grade < lowest) Then
                lowest = grade
            End If
        Next
        Console.WriteLine("The highes class score: " + highest.ToString())
        Console.WriteLine("The lowest class score: " + lowest.ToString())


        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
APPROVED BY CLIENTS