Friday 26 April 2013

lab at home c#

1.  Diaz Entertainment, Inc. has to develop a software application for young children that would enable them to identify and distinguish shapes and colors. The application should ask the name of the shape, its area, and color. Once the input is provided, the application should draw the shape with the same area and color as entered by the user. You, as part of the development team, have to define the Geometrical_Shapes class that should have methods to accept the input from the users, display the input as entered by the user, and display the shapes with the same color and area. You have written the following code: 

using system;
class Geometrical_shapes
{
    double Area;
    string Shape;
    string color;
 public void GetInput()
{
   console.write("Enter the of the Shape:");
   Shape = console.ReadLine();
   console.Write("Enter the Color:");
   Color = Console.ReadLine();
   Console.Write("Enter the Area:");
   Area = Console.ToDouble(console.ReadLine());
}
Publicvoid Display ()
{
   Console.WriteLine();
   Console.WriteLine("THISIS WHAT YOU ENTERED: \n");
   console.write("Name of the Shape:");
   console.WriteLine(Shape);
   console.write("Color:");
   Console.WriteLine("Color");
   Console.write("Area:");
   Console.writeLine(Area);
  }
}
class Classy
{
 static void Main(string[]args)
{
 Geometrical Shapes_Small_rectangle = new Geometrical_Shapes();
 Small rectangle.Create();
 Small rectangle.Display();
 Console.ReadLine();
  }
}



No comments:

Post a Comment