Question: The provided file has syntax and/or logical errors. Determine the problem(s) and fix the program. // Creates a Breakfast class // and instantiates an object
The provided file has syntax and/or logical errors. Determine the problem(s) and fix the program.
// Creates a Breakfast class // and instantiates an object // Displays Breakfast special information using static System.Console; class DebugNine2 { static void Main() { Breakfast special = new Breakfast("French toast", 4.99); //Display the info about breakfast WriteLine(special.INFO); // then display today's special WriteLine("Today we are having {0} for {1}", special.Name, special.Price.ToString("C2")); } } class Breakfast { public string INFO = "Breakfast is the most important meal of the day."; // Breakfast constructor requires a // name, e.g "French toast", and a price public Breakfast(string name, double price) { Name = name; Price = price; } public string Name {get; set;} public double Price {get; set;} }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
