can you find the errors: internal class Program { static void Main(string[] args) {…
- User
can you find the errors: internal class Program { static void Main(string[] args) { Console.WriteLine("**************** INVOICE PRINTER ****************"); double cost, discount, tax; string customerName, customerType, state; string doAgain = "y"; do { try { Console.Write("Please enter the customer's name: "); customerName = Console.ReadLine(); Console.Write("Enter the type of customer (either R for retail or C for corporate): "); customerType = Console.ReadLine(); Console.Write("Enter the customer's state (IL, IN, or WI): "); state = Console.ReadLine(); Console.Write("Enter the amount of the purchase: "); cost = Convert.ToDouble(Console.ReadLine()); discount = 0; tax = 0; if (customerType.Equals("R")) { if (cost >= 500) { discount = cost * 0.2;
} else if (cost >= 250 && cost <500){ discount = cost * 0.1; } else { discount = cost * 0; } } else if (customerType.Equals("C")) { if (cost >= 1000) { discount = cost * 0.3; } else if (cost >= 500 && cost < 1000) { discount = cost * 0.2; } else { discount = cost * 0; } }codeif (state.Equals("IL")) { tax = 0.0875 * cost; } else if (state.Equals("IN")) { tax = 0.0825 * cost; } else if (state.Equals("WI")) { tax = 0.085 * cost; } Console.WriteLine("Here is the customer " + customerName + " from " + state); Console.WriteLine("Cost of items purchased: " + "$"+cost); Console.WriteLine("Discount applied " + "$"+discount); Console.WriteLine("Taxes applied: " + "$"+tax); Console.Write("Do you have another employee? "); doAgain = Console.ReadLine().ToLower(); } catch (Exception ex) { Console.WriteLine("Your input is invalid"); } } while (doAgain.Equals("y") || doAgain.Equals("yes")); Console.WriteLine("Thank you for using this program"); } } - Assistant
No errors found.