0% found this document useful (0 votes)
108 views2 pages

Mobile Application Practical 20

The document contains code that defines two classes - Person and Employee. Employee inherits from Person and adds a salary property. It also defines methods to get and display person/employee details. The Main method creates an Employee object, calls the get methods to collect name, city and salary, and then displays the details. The second part of the code defines two more classes - Signal and Concat. Concat inherits from Signal and adds a method to concatenate two strings entered by the user and display the result. The Main method creates a Concat object and calls the string collection and concatenation methods.

Uploaded by

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

Mobile Application Practical 20

The document contains code that defines two classes - Person and Employee. Employee inherits from Person and adds a salary property. It also defines methods to get and display person/employee details. The Main method creates an Employee object, calls the get methods to collect name, city and salary, and then displays the details. The second part of the code defines two more classes - Signal and Concat. Concat inherits from Signal and adds a method to concatenate two strings entered by the user and display the result. The Main method creates a Concat object and calls the string collection and concatenation methods.

Uploaded by

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

Imports System.

console
Module Module1
Class person
Dim name As String
Dim city As String
Public Function get_person()
Console.WriteLine("Enter A Name of a Person")
Console.WriteLine("Enter A City of a person")
name = Console.ReadLine()
city = Console.ReadLine()
Return 0
End Function
Public Function show_person()
Console.WriteLine("Name of a Person " & name)
Console.WriteLine("City of a person " & city)
Return 0
End Function
End Class
Class employee
Inherits person
Dim sal As Double
Public Function get_emp()
Console.WriteLine("Enter A Salary of Employee")
sal = Console.ReadLine()
Return 0
End Function
Public Function show_emp()
Console.WriteLine("Salary Of the employee = {0}", sal)
Return 0
End Function
End Class
Sub Main()
Dim s As employee = New employee()
s.get_person()
s.get_emp()
s.show_person()
s.show_emp()
Console.ReadKey()
End Sub
End Module
Imports System.console
Module Module1
Dim str1 As String
Dim str2 As String
Dim str3 As String
Class signal
Public Function a_string()
Console.WriteLine("Enter The String: ")
Console.WriteLine("First String: ")
str1 = Console.ReadLine()
Return 0

End Function
End Class
Class concat
Inherits signal
Public Function b_string()
Console.WriteLine("Second String")
str2 = Console.ReadLine()
str3 = str1 + str2
Console.WriteLine("the Concatinate String is {0}", str3)

Return 0
End Function
End Class
Sub main()
Dim a As concat = New concat
a.a_string()
a.b_string()
Console.ReadKey()
End Sub
End Module

You might also like