rei
New member
- Joined
- Sep 2, 2015
- Messages
- 4
- Programming Experience
- Beginner
I am new to C# and this code was on one of the tutorials but it didn't give much of an explanation of what each line does.
The code:
The code:
using System; namespace RectangleApplication { class Rectangle { 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(); } } }
Attachments
Last edited by a moderator: