Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pizza.cs file using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PizzaApplication { public enum PizzaType {ChicagoStyle, Greek, Veggie, Cheese } public class

Pizza.cs file

using System;

using System.Collections.Generic; using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace PizzaApplication

{

public enum PizzaType {ChicagoStyle, Greek, Veggie, Cheese } public class Pizza

{

public void Prepare(PizzaType tp)

{

switch (tp)

{

case PizzaType.ChicagoStyle: PrepareIngredientsForChicagoStylePizza(); break;

case PizzaType.Greek: PrepareIngredientsForGreekPizza(); break;

case PizzaType.Veggie: PrepareIngredientsForVeggiePizza(); break;

case PizzaType.Cheese: PrepareIngredientsForGreekPizza(); break;

default:

PrepareIngredientsForUnknownPizza(); break;

}

}

public void PrepareIngredientsForChicagoStylePizza()

{

Console.WriteLine("Preparing ingredients for the Chicago-style pizza");

}

public void PrepareIngredientsForGreekPizza()

{

Console.WriteLine("Preparing ingredients for the Greek pizza");

}

public void PrepareIngredientsForVeggiePizza()

{

Console.WriteLine("Preparing ingredients for the veggie pizza");

}

public void PrepareIngredientsForCheesePizza()

{

Console.WriteLine("Preparing ingredients for the cheese pizza");

}

public void PrepareIngredientsForUnknownPizza()

{

Console.WriteLine("Preparing ingredients for this pizza is unknown");

}

}

}

Program.cs

using System;

using System.Collections.Generic; using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace PizzaApplication

{

class Program

{

static void Main(string[] args)

{

Pizza p = new Pizza(); p.Prepare(PizzaType.Veggie); p.Prepare(PizzaType.Cheese); p.Prepare(PizzaType.ChicagoStyle);

Console.ReadLine();

}

}

}

For the C# application above, apply the tasks below:

Implement the pizza application and run it on your .NET

Implement the same application by using an interface.

What is the difference between the first and second applications? Explain your opinion briefly.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Explain the importance of selling based u pon benefits.

Answered: 1 week ago