Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Module Module1
- Sub Main()
- 'instatiate a customer name the object BigSpender..
- 'instatiate an employee name the object SalesMan
- ' try to instatiate a person
- 'Make sure you do all the tasks below before doing this.
- ' assign fictional details to your Salesman
- Console.ReadLine()
- End Sub
- End Module
- MustInherit Class Person 'and abstract class
- Protected Name As String
- Protected Address As String
- Protected City As String
- Protected County As String
- Protected PostCode As String
- MustOverride Sub PrintName()
- ' add abstract methods to set the values for each property
- Sub Print() ' this isn't an abstarct method but access the abstact method which is overridden in the sub(now base) classes
- PrintName()
- Console.WriteLine(Address)
- Console.WriteLine(City & ", " & County & " " & PostCode)
- End Sub
- End Class
- Class Customer
- Inherits Person
- Overrides Sub PrintName()
- Console.Write("Customer ")
- Console.WriteLine(Name)
- End Sub
- 'create setter and getter methods for each of the inherited properties
- Private CustomerID As Integer
- End Class
- Class Employee
- Inherits Person
- Overrides Sub PrintName()
- Console.Write("Employee ")
- Console.WriteLine(Name)
- End Sub
- ' create a method that calculates salary using the formula 10000+(200*yearsService)+(0.05*sales) .... you will need to either hards code or input sales and years service for teating
- Private Salary As Integer
- Private Sales As Integer
- Private YearsService As Integer
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement