well.. I don't think u can do this(mostly because it doesn't work) so umm.. what is the snippet for it? umm.. just tell me why this doesn't work. thanks
Code:class Shapes { public class Area { public double Square(double Length) { return Length * Length; } public double Rectangle(double Length, double Width) { return Length * Width; } public double Triangle(double Base, double Height) { return .5 * (Base * Height); } public double Circle(double Radius) { return Math.PI * (Radius * Radius); } public double Parallelogram(double Base, double Height) { return Base * Height; } public double Trapezoid(double Length1, double Length2, double Height) { return .5 * Height * (Length1 * Length2); } } public class Perimeter { public double Square(double Length) { return Length * 4; } public double Rectangle(double Length, double Width) { return (Length * 2) + (Width * 2); } public double Triangle(double Length1, double Length2, double Length3) { return Length1 + Length2 + Length3; } public double Circle(double Radius) { return 2 * Math.PI * Radius; } public double Parallelogram(double Length1, double Length2) { return (2 * Length1) + (2 * Length2); } public double Trapezoid(double bottomBase, double leg1, double leg2, double topBase) { return bottomBase + leg1 + leg2 + topBase; } } }




Reply With Quote