The document defines three classes - Staff, Teacher, and SupportStaff. Staff is the base class with protected properties for staff ID, name, and salary. Teacher inherits from Staff with additional private properties for class and form. SupportStaff also inherits from Staff with private properties for type and department. Both Teacher and SupportStaff have constructors to initialize the properties and a show method to output the property values. The Main method creates a Teacher object and calls its show method.
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 ratings0% found this document useful (0 votes)
49 views2 pages
Staffid Name Salary
The document defines three classes - Staff, Teacher, and SupportStaff. Staff is the base class with protected properties for staff ID, name, and salary. Teacher inherits from Staff with additional private properties for class and form. SupportStaff also inherits from Staff with private properties for type and department. Both Teacher and SupportStaff have constructors to initialize the properties and a show method to output the property values. The Main method creates a Teacher object and calls its show method.
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/ 2
Class staf
Protected staffid As String
Protected name As String Protected salary As Double End Class Class teacher Inherits staf Private Cl As String Private form As String Public Sub New(ByVal x As String, ByVal y As String, ByVal z As Double, ByVal a As String, ByVal b As String) staffid = x name = y salary = z Cl = a form = b End Sub Public Sub show() Console.WriteLine(staffid) Console.WriteLine(name) Console.WriteLine(salary) Console.WriteLine(Cl) Console.WriteLine(form)
End Sub
End Class Class supportstaf Inherits staf
Private type As String
Private dept As String Public Sub New(ByVal x As String, ByVal y As String, ByVal z As Double, ByVal a As String, ByVal b As String) staffid = x name = y salary = z type = a dept = b End Sub Public Sub show() Console.WriteLine(staffid, name, salary, type, dept) End Sub
End Class Sub Main() Dim x As teacher = New teacher("23dd2", "ali", 22.4, "6b", "3d") x.show() Console.ReadLine() End Sub
Instant download Object Oriented Software Engineering Using UML Patterns and Java 3rd Edition by Bernd Bruegge, Allen H Dutoit ISBN 0133002098 9780133002096 ebook 2025 edition