using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Pizza { public string pizzaSize; public bool meat; public string customer; //constructor public Pizza() { pizzaSize = "Medium"; meat = false; customer = "John Doe"; } public void OrderDetails() { Console.WriteLine(customer + " has ordered a " + pizzaSize + " pizza."); if(meat == true) { Console.WriteLine("The pizza contains meat."); } else { Console.WriteLine("The pizza contains no meat."); } } public void AddMeat() { meat = true; } /* //properties public string PizzaSize { //lets us access the value stored here get { return pizzaSize; } //lets us change the value stored here set { if ((value == "Large") || (value == "Small")) pizzaSize = value; } } public string Customer { //lets us access the value stored here get { return customer; } //lets us change the value stored here set { customer = value; } } */ using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Pizza myPizza; myPizza = new Pizza(); myPizza.AddMeat(); myPizza.customer = "Sandra Jones"; myPizza.pizzaSize = "Small"; myPizza.OrderDetails(); Pizza someoneElsesPizza = new Pizza(); someoneElsesPizza.OrderDetails(); string testCustomerProperty; testCustomerProperty = someoneElsesPizza.customer; Console.WriteLine(testCustomerProperty + " ordered someone else's pizza"); string testPizzaSizeProperty; testPizzaSizeProperty = someoneElsesPizza.pizzaSize; Console.WriteLine("and he ordered the size " + testPizzaSizeProperty); } } } } }