Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AreaCalc/AreaCalc/Circle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ namespace AreaCalc
{
public class Circle
{
public Decimal Area(double width)
public Decimal Area(decimal width)
{
double area = Math.PI * (Math.Pow(width, 2.0));
double area = Math.PI * (Math.Pow(Double.Parse(width + ""), 2.0));
return Decimal.Parse(area + "");
}
}
Expand Down
26 changes: 13 additions & 13 deletions AreaCalc/AreaCalc/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ static void Main(string[] args)
{
Console.WriteLine("Hello, welcome to the area calculator");
Console.Write("Please select your width for the cicle: ");
int width = int.Parse(Console.ReadLine());
Circle circle = new Circle(width);
Console.WriteLine("The area of your cicle is: " + circle.Area());
Decimal width = Decimal.Parse(Console.ReadLine());
Circle circle = new Circle();
Console.WriteLine("The area of your cicle is: " + circle.Area(width));
Console.Write("Please select your width for the triangle: ");
width = int.Parse(Console.ReadLine());
Triangle triangle = new Triangle(width);
Console.WriteLine("The area of your triangle is: " + triangle.Area());
width = Decimal.Parse(Console.ReadLine());
Triangle triangle = new Triangle();
Console.WriteLine("The area of your triangle is: " + triangle.Area(width));
Console.Write("Please select your width for the square: ");
width = int.Parse(Console.ReadLine())
Square square = new Square(width);
Console.WriteLine("The area of your square is: " + square.Area());
width = Decimal.Parse(Console.ReadLine());
Square square = new Square();
Console.WriteLine("The area of your square is: " + square.calculateSquareArea((double)width));
Console.Write("Please select your width for the rectangle: ");
width = int.Parse(Console.ReadLine());
width = Decimal.Parse(Console.ReadLine());
Console.Write("Please enter in the height of your rectangle: ");
int height = int.Parse(Console.ReadLine())
Rectangle rectangle = new Rectangle(width, height);
Console.WriteLine("The area of your square is: " + rectangle.Area());
Decimal height = Decimal.Parse(Console.ReadLine());
Reactangle rectangle = new Reactangle();
Console.WriteLine("The area of your square is: " + rectangle.reactangleArea(width, height));
}
}
}
2 changes: 1 addition & 1 deletion AreaCalc/AreaCalc/Square.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Git_test
namespace AreaCalc
{
class Square
{
Expand Down