Module Module1
Public Class person
Public personName As String
Public phoneNumber As String
Public Sub showPersonData()
Console.writeLine("Name : " & personName)
Console.writeLine("CPI : " & phoneNumber)
End Sub
End Class
Public Class student
Inherits person
Public rollNumber As Integer
Public cpi As Double
Public Sub showStudentData()
Console.WriteLine("Roll Number : " & rollNumber)
Console.WriteLine("CPI : " & cpi)
End Sub
End Class
Public Class employee
Inherits person
Public empId As Integer
Public salary As Double
Public Sub showEmployeeData()
Console.WriteLine("Employee ID : " & empId)
Console.WriteLine("Salary : " & salary)
End Sub
End Class
Sub Main()
Dim studentObj As student = New student()
studentObj.personName = "Jaydip Panchal"
studentObj.phoneNumber = 7878314409
studentObj.rollNumber = 61
studentObj.cpi = 7.28
Console.writeLine("Student Data : ")
studentObj.showPersonData()
studentObj.showStudentData()
Dim employeeObj As employee = New employee()
employeeObj.personName = "Pratik Patel"
employeeObj.phoneNumber = 9429389214
employeeObj.empId = 50
employeeObj.salary = 25000
Console.writeLine("Employee Data : ")
employeeObj.showPersonData()
employeeObj.showEmployeeData()
Console.ReadLine()
End Sub
End Module