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.
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
Comments
Leave a comment