Lab 6
Lab 6
Con
Imports System.Console
Imports System.Math
Module Module1
Sub Main()
Dim A, B As Double
Write("Enter the first number : ")
A = ReadLine()
Write("Enter the second number : ")
B = ReadLine()
If (A > B) Then
WriteLine(">>> First number is larger than the second. ")
End If
If (A < B) Then
WriteLine(">>> Second number is larger than the first. ")
End If
ReadKey()
End Sub
End Module
//////////////////////////////////////////////////////////////////////////////////////
Form
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim A, B As Double
A = TextBox1.Text
B = TextBox2.Text
If (A > B) Then
Label3.Text = "First number is larger than the second."
End If
If (A < B) Then
Label3.Text = "Second number is larger than the first."
End If
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
End Class
LAB6-2
Con
Imports System.Console
Imports System.Math
Module Module1
Sub Main()
Dim A, B, C As Double
Write("Enter the first number : ")
A = ReadLine()
Write("Enter the second number: ")
B = ReadLine()
Write("Enter the third number: ")
C = ReadLine()
If (A > B) And (A > C) Then
WriteLine(">>> The Largest number is {0}. ", A)
ElseIf (B > A) And (B > C) Then
WriteLine(">>> The Largest number is {0}. ", B)
ElseIf (C > A) And (C > B) Then
WriteLine(">>> The Largest number is {0}. ", C)
End If
ReadKey()
End Sub
End Module
///////////////////////////////////////////////////////////////////////////////
Form
LAB6-3
Con
Imports System.Console
Imports System.Math
Module Module1
Sub Main()
Dim A As Double
Write("Enter score : ")
A = ReadLine()
If (A < 50) Then
WriteLine("You got F. ")
ElseIf (A < 55) Then
WriteLine("You got D. ")
ElseIf (A < 60) Then
WriteLine("You got C. ")
ElseIf (A < 65) Then
WriteLine("You got C+. ")
ElseIf (A < 73) Then
WriteLine("You got B. ")
ElseIf (A < 80) Then
WriteLine("You got B+. ")
ElseIf (A < 90) Then
WriteLine("You got A. ")
Else
WriteLine("You got A+. ")
End If
ReadKey()
End Sub
End Module
/////////////////////////////////////////////////////////////////////////////////////////////////////////
Form
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim A As Double
A = TextBox1.Text
If (A < 50) Then
Label2.Text = "You got F. "
ElseIf (A < 55) Then
Label2.Text = "You got D. "
ElseIf (A < 60) Then
Label2.Text = "You got C. "
ElseIf (A < 65) Then
Label2.Text = "You got C+. "
ElseIf (A < 73) Then
Label2.Text = "You got B. "
ElseIf (A < 80) Then
Label2.Text = "You got B+. "
ElseIf (A < 90) Then
Label2.Text = "You got A. "
Else
Label2.Text = "You got A+. "
End If
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
End Class
----------------------------------------------------------------------------------------------------------------------------------------
LAB 6-4
Con
Imports System.Console
Imports System.Math
Module Module1
Sub Main()
Dim A As Double
Write("Enter score :
A = ReadLine()
Select Case A
Case 0 To 49
WriteLine("You
Case 50 To 54
WriteLine("You
Case 55 To 59
WriteLine("You
Case 60 To 64
WriteLine("You
Case 65 To 72
WriteLine("You
Case 73 To 79
WriteLine("You
Case 80 To 89
WriteLine("You
Case 90 To 100
WriteLine("You
End Select
ReadKey()
End Sub
End Module
")
got F. ")
got D. ")
got C. ")
got C+. ")
got B. ")
got B+. ")
got A. ")
got A+. ")
///////////////////////////////////////////////////////////////////////////////////////////////////////////
Form
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim A As Double
A = TextBox1.Text
Select Case A
Case 0 To 49
Label2.Text = "You got F. "
Case 50 To 54
Label2.Text =
Case 55 To 59
Label2.Text =
Case 60 To 64
Label2.Text =
Case 65 To 72
Label2.Text =
Case 73 To 79
Label2.Text =
Case 80 To 89
Label2.Text =
Case 90 To 100
Label2.Text =
End Select
End Sub
End Class