Answer to Question #309566 in Visual Basic for dee

Question #309566

students in the BIT Level 300 class obtained

various grades in a Mid sem exam. A

computer program is needed to find the

highest and lowest class score.

Create an algorithm for the computer

program needed to solve the above problem.


1
Expert's answer
2022-03-11T07:24:02-0500


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