using System; namespace FunnelTest { class FunnelMain { [STAThread] static void Main(string[] args) { int Par = 8; try { Funnel MyFunnel= new Funnel(Par); MyFunnel.funnelDraw() ; Console.WriteLine("{0}! = {1};",Par,MyFunnel.funnelFactorial()); } catch (System.FormatException e) { Console.WriteLine(e.Message.ToString()); } Console .Read(); } } public class Funnel { private int num; public Funnel(int _num) { if(_num < 5 || _num > 15) { throw new System.FormatException("The input parameters must be between 5 and 15 Time! The object cannot be initialized. "); } else num = _num; } public Funnel() { throw new System.FormatException("The parameter cannot be empty.
"); } public void funnelDraw() { int temp = num; while(temp > 1) { for(int j=temp;j>0;j--) { Console.Write("*"); } Console. Write("\n"); temp--; } while(temp <= num) { for(int j=temp;j>0;j--) { Console.Write("*"); } Console.Write ("\n"); temp++; } } public int funnelFactorial() { int Fac = 1; for(int i=1;i<=num;i++) { Fac *= i; } return Fac; } } }< /p>