Question: This code is not loutputing correctly. help // Creates a Breakfast class // and instantiates an object // Displays Breakfast special information using System; using
This code is not loutputing correctly. help
// Creates a Breakfast class
// and instantiates an object
// Displays Breakfast special information
using System;
using static System.Console;
using System.Globalization;
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", CultureInfo.GetCultureInfo("en-US")));
}
}
class Breakfast
{
public string INFO =
"Breakfast is the most important meal of the day.";
public string name;
// Breakfast constructor requires a
// name, e.g "French toast", and a price
public Breakfast(string n, double p)
{
name = n;
Price = p;
}
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
