w3c rektangel
This commit is contained in:
parent
655eca3ccf
commit
3df0f671b8
16
Emne 3/ConsoleApp6/ConsoleApp6.sln
Normal file
16
Emne 3/ConsoleApp6/ConsoleApp6.sln
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "w3cRectangle", "w3cRectangle\w3cRectangle.csproj", "{1A5EE44F-A5A5-48F7-9AC4-5B8CCE783322}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1A5EE44F-A5A5-48F7-9AC4-5B8CCE783322}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1A5EE44F-A5A5-48F7-9AC4-5B8CCE783322}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1A5EE44F-A5A5-48F7-9AC4-5B8CCE783322}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1A5EE44F-A5A5-48F7-9AC4-5B8CCE783322}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
41
Emne 3/ConsoleApp6/w3cRectangle/Program.cs
Normal file
41
Emne 3/ConsoleApp6/w3cRectangle/Program.cs
Normal file
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
|
||||
namespace RectangleApplication
|
||||
{
|
||||
class Rectangle
|
||||
{
|
||||
// Member values
|
||||
double length;
|
||||
double width;
|
||||
|
||||
public void Acceptdetails()
|
||||
{
|
||||
length = 4.5;
|
||||
width = 3.5;
|
||||
}
|
||||
|
||||
public double GetArea()
|
||||
{
|
||||
return length * width;
|
||||
}
|
||||
|
||||
public void Display()
|
||||
{
|
||||
Console.WriteLine("Length: {0}", length);
|
||||
Console.WriteLine("Width: {0}", width);
|
||||
Console.WriteLine("Area: {0}", GetArea());
|
||||
}
|
||||
}
|
||||
|
||||
class ExecuteRectangle
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Rectangle r = new Rectangle();
|
||||
r.Acceptdetails();
|
||||
r.Display();
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
10
Emne 3/ConsoleApp6/w3cRectangle/w3cRectangle.csproj
Normal file
10
Emne 3/ConsoleApp6/w3cRectangle/w3cRectangle.csproj
Normal file
|
@ -0,0 +1,10 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
Loading…
Reference in a new issue