Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double width, height, woodLength, glassArea;
- const double MAX_WIDTH = 5.0;
- const double MIN_WIDTH = 0.5;
- const double MAX_HEIGHT = 3.0;
- const double MIN_Height = 0.75;
- string widthString, heightString;
- Console.WriteLine("please enter width of the window");
- widthString = Console.ReadLine();
- width = Convert.ToDouble(widthString);
- if (width < MIN_WIDTH)
- {
- Console.WriteLine("you enter vaule less than min width n"+ "using mininium one");
- width = MIN_WIDTH;
- }
- if (width>MAX_WIDTH)
- {
- Console.WriteLine("you entered value grater than MaX widthn" + "using maxuimum one");
- width = MAX_WIDTH;
- }
- Console.WriteLine("please enter your height of the window");
- heightString = Console.ReadLine();
- height = double.Parse(heightString);
- if (height<MIN_Height)
- {
- Console.WriteLine("you enter vaule less than min width n" + "using mininium one");
- height = MIN_Height;
- }
- if (height > MAX_HEIGHT)
- {
- Console.WriteLine("you enter value grater than Max heightn" + "using maxuimum one");
- height = MAX_HEIGHT;
- }
- woodLength = 2 * (width+height) * 3.25;
- glassArea = 2 * (width * height);
- Console.WriteLine("the lenth of the wood is "+woodLength+"feet");
- Console.WriteLine("the area of the glass is " + glassArea +"m^2");
Add Comment
Please, Sign In to add comment