Guest User

Untitled

a guest
Dec 10th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. double width, height, woodLength, glassArea;
  2. const double MAX_WIDTH = 5.0;
  3. const double MIN_WIDTH = 0.5;
  4. const double MAX_HEIGHT = 3.0;
  5. const double MIN_Height = 0.75;
  6. string widthString, heightString;
  7. Console.WriteLine("please enter width of the window");
  8. widthString = Console.ReadLine();
  9. width = Convert.ToDouble(widthString);
  10. if (width < MIN_WIDTH)
  11. {
  12. Console.WriteLine("you enter vaule less than min width n"+ "using mininium one");
  13. width = MIN_WIDTH;
  14. }
  15. if (width>MAX_WIDTH)
  16. {
  17. Console.WriteLine("you entered value grater than MaX widthn" + "using maxuimum one");
  18.  
  19. width = MAX_WIDTH;
  20. }
  21. Console.WriteLine("please enter your height of the window");
  22. heightString = Console.ReadLine();
  23. height = double.Parse(heightString);
  24. if (height<MIN_Height)
  25. {
  26. Console.WriteLine("you enter vaule less than min width n" + "using mininium one");
  27. height = MIN_Height;
  28.  
  29. }
  30. if (height > MAX_HEIGHT)
  31. {
  32. Console.WriteLine("you enter value grater than Max heightn" + "using maxuimum one");
  33. height = MAX_HEIGHT;
  34. }
  35. woodLength = 2 * (width+height) * 3.25;
  36. glassArea = 2 * (width * height);
  37. Console.WriteLine("the lenth of the wood is "+woodLength+"feet");
  38. Console.WriteLine("the area of the glass is " + glassArea +"m^2");
Add Comment
Please, Sign In to add comment