using System; namespace ConsoleApplication1 { // // Problem Set 1, Question 1 // Written by Paul Hudak // Sept 19, 2006 // class PS1_Q1 { // // Problem 18 in the text // [STAThread] static void Main(string[] args) { int x; // query user for input, then compute and display result Console.Write("Please type in the first number: "); x = int.Parse(Console.ReadLine()); Console.WriteLine("The polynomial evaluates to: {0}\n", Poly(x)); // do all of the above once more Console.Write("Please type in the next number: "); x = int.Parse(Console.ReadLine()); Console.WriteLine("The polynomial evaluates to: {0}\n", Poly(x)); } public static int Poly(int x) { // computes a polynomial return (4*x*x + 3*x - 5); } } }