I'm stuck on this program where I have to create Implement a class Pizza which I did
The part where I got stuck sounds like this
Create a class MenuCatalog, that contains pizzas, and implement methods for CRUD operations (Create, Read, Update and Delete).
Implement a method, PrintMenu, that can print out the menu card (to the screen).
Implement a method SearchPizza(criteria), that searches for a pizza and returns a Pizza object.
In the class Store implement code to test the implemented classes and methods in step 2.
Create a user dialog for the system. Create a method menu choice that prints out a list of menu items and reads the users choice
- Add new to pizza to the menu
- Delete pizza
- Update pizza
- Search pizza
- Display pizza menu
So far my program looks like this on the pizza class :
using System;
namespace PizzaStore
{
public class Pizza
{
private int _pizzaID;
private double _price;
private string _size;
private Topping _toppings;
public Pizza (int pizzaID, double price, string size, Topping toppings)
{
_pizzaID = pizzaID;
_price = price;
_size = size;
_toppings = toppings;
}
public int pizzaID
{
get { return _pizzaID; }
set { _pizzaID = value; }
}
public double price
{
get { return _price; }
set { _price = value; }
}
public string size
{
get { return _size; }
set { _size = value; }
}
public Topping toppings
{
get { return _toppings; }
set { _toppings = value; }
}
public override string ToString()
{
return $"The pizza ID is {_pizzaID}, the size is {_size}, with {_toppings.Name}. The price is {_price}.";
}
//
}
The part where I got really stuck is at the Menu catalog thing :( I'm stuck even at basic stuff such as inserting items, because wherever I search something I'll find different forms that will not work with this.
I tried something like this :
- Creating a
public class MenuCatalog
- I declared and
int index = 0
- Made a
List<MenuCatalog> Pizza = new List<MenuCatalog>
and then trying to create items based on that.
Or I tried with different forms for the inseration such as Pizza p1 = new Pizza( ) ;
Any ideeas on how I should proceed, please? :(