0% found this document useful (0 votes)
12 views13 pages

GAD - Program (1) (AutoRecovered)

The document contains examples of programs to implement various concepts in VB.Net like arithmetic operations, conditional statements, loops, functions, classes, inheritance, method overloading, exception handling and more using different controls.

Uploaded by

harshgbirje
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views13 pages

GAD - Program (1) (AutoRecovered)

The document contains examples of programs to implement various concepts in VB.Net like arithmetic operations, conditional statements, loops, functions, classes, inheritance, method overloading, exception handling and more using different controls.

Uploaded by

harshgbirje
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

1. Implement the program to generate result of any arithmetic operation using MsgBox ().

2. Write a program using if-else statement.

3. Implement the program for finding greatest of three numbers.


4. Implement the program using if-else statement to find the number is even or odd.

5. Write a program using Select Case statement in VB.Net.


6. Write a program using While & Do loop statements in VB.Net.

7. Write a program using While statement to print even-odd numbers between 1-50
8. Write a program using For & For Each statement

9. Write a program using For Next loop statement to find the Armstrong numbers between 1 to
500(153 is Armstrong number 13 +53 +33 =153)

10. Write a program to change the background color of the form when user clicks on different
button.
11. Write a program using Radio button to change the bulb state ON/OFF (Use two images one for
ON state and another for Off State)

12. Write a program to change the forecolor of the text in Label (Use different radio buttons for
colors i.e. Red, Green, Blue

13. Implement a program for student registration which will allow the student to register for
multiple subjects for single semester using List & Combo box.
14. Write a program to display the traffic signal using timer control

15. Write a program code perform the date Validation using ErrorProvider Control

16. Write a Program using ErrorProivider for username & password authentication
17. Write a Program using ErrorProvider control to validate the Mobile Number and Email ID in GUI
application

18. Write a Program using sub procedure & parameterized sub procedures.
19. Develop a program to print the reverse of any number using Sub Procedure.

20. Write a program using simple function & parameterized function.

21. Write a program to identify Volume of Box class, with three data members, length, breadth and
height
22. Implement a program to accept values from combobox and display average of this in message
box using a class.

23. Implement a program to calculate area of circle using parameterized constructor.

24. Implement a Program for inheritance where Student is Child class and faculty is Base class.
(Take Appropriate variables in Base and child class)

Module Module1
Class faculty
Public name As String
Public subject As String
Public Sub getdata()
Console.WriteLine("Enter the name")
name = Console.ReadLine()
Console.WriteLine("Enter the Sub")
subject = Console.ReadLine()
End Sub
End Class
Class student
Inherits faculty
Dim s_name As String
Dim s_roll As Integer
Sub accept()
Console.WriteLine("Enter the name of the student")
s_name = Console.ReadLine()
Console.WriteLine("Enter the Roll of the student")
s_roll = Console.ReadLine()
End Sub
Sub display()
Console.WriteLine("The name of the faculty is " & name)
Console.WriteLine("The subject is:" & subject)
Console.WriteLine("The name of the Student is" & s_name)
Console.WriteLine("The roll no of the student is " & s_roll)
End Sub
End Class
Sub Main()
Dim s1 As student = New student
s1.getdata()
s1.accept()
s1.display()
Console.ReadLine()
End Sub
End Module

25. Write a program to implement the concept of method overloading & overriding

Module Module1

Class Animal
' Method to make the animal sound
Overridable Sub MakeSound()
Console.WriteLine("The animal makes a generic sound.")
End Sub

' Method to make the animal move


Overridable Sub Move()
Console.WriteLine("The animal moves.")
End Sub
End Class

Class Dog
Inherits Animal

' Overriding the MakeSound method to make a dog-specific sound


Overrides Sub MakeSound()
Console.WriteLine("The dog barks.")
End Sub

' Overloading the Move method to specify how a dog moves


Overrides Sub Move()
Console.WriteLine("The dog runs.")
End Sub
End Class

Sub Main()
Dim animal As New Animal()
Dim dog As New Dog()

' Call the MakeSound method for the animal object


animal.MakeSound()

' Call the Move method for the animal object


animal.Move()

' Call the MakeSound method for the dog object


dog.MakeSound()

' Call the Move method for the dog object


dog.Move()

Console.ReadLine()
End Sub

End Module

26. Write a program for student registration using exception handling

Module Module1
Dim name As String
Dim rollno As Integer
Dim per As Double
Dim ch As Boolean
Sub Form()
Console.WriteLine("Fill Registration Form: ")
Console.WriteLine("Enter name , rollno and percentage:")
name = Console.ReadLine()
rollno = Console.ReadLine()
per = Console.ReadLine()
End Sub

Sub Main()
Module1.Form()
Try
ch = per > 0 And per < 100
If ch Then
Console.WriteLine("Form Filled Sucessfully")
Else
Throw New Exception("Invalid-Range")
End If
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
Console.ReadKey()
End Sub

End Module

You might also like