public Product(string name, double price)
public override string ToString()
string str = string.Format("{0;C}",price);
return "The Product is: " + name + " at this price: " + str;
public static void Main()
Console.WriteLine("Enter the name of the product: ");
string name = Console.ReadLine();
Console.WriteLine("Enter the price of the product: ");
double price = Double.Parse(Console.ReadLine());
Product product = new Product(name, price);
Console.WriteLine(product.ToString());