-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.12.35323.107 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "InheritArea", "InheritArea.vbproj", "{45092605-64E0-4196-9352-2E15C128EE72}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{45092605-64E0-4196-9352-2E15C128EE72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{45092605-64E0-4196-9352-2E15C128EE72}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{45092605-64E0-4196-9352-2E15C128EE72}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{45092605-64E0-4196-9352-2E15C128EE72}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {E30C6DF2-6A25-4F71-AAB8-2BBBCF09DBDF} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<RootNamespace>InheritArea</RootNamespace> | ||
<TargetFramework>net8.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Module Module1 | ||
Class Rectangle | ||
Public Length As Integer | ||
Public Width As Integer | ||
|
||
Public Sub SetValues(len As Integer, wid As Integer) | ||
Length = len | ||
Width = wid | ||
End Sub | ||
|
||
Public Function CalculateArea() As Integer | ||
Return Length * Width | ||
End Function | ||
End Class | ||
|
||
Class Square | ||
Inherits Rectangle | ||
|
||
Public Function CalculateSquareArea() As Integer | ||
Return Length * Length | ||
End Function | ||
End Class | ||
|
||
Sub Main() | ||
Dim rect As New Rectangle() | ||
rect.SetValues(5, 10) | ||
Console.WriteLine("Area of Rectangle: " & rect.CalculateArea()) | ||
|
||
Dim sqr As New Square() | ||
sqr.Length = rect.Length | ||
Console.WriteLine("Area of Square (using length from base): " & sqr.CalculateSquareArea()) | ||
|
||
Console.ReadLine() | ||
End Sub | ||
End Module |