namespace CarShopConsoleApp
static void Main(string[] args)
Console.WriteLine("Welcome to the Car Store. First you must create some car inventory. \nThen you may add some cars to the shopping cart. \nFinally you may checkout which will give you a total value of the shopping cart.\n");
int action = chooseAction();
Console.WriteLine("\nYou chose " + action);
Console.WriteLine("\nYou choose to add a new car to the inventory");
Decimal carEngineSize = 0;
Console.WriteLine("\nWhat is the car make?, Ford, GM, Nissan... etc.");
carMake = Console.ReadLine();
Console.WriteLine("\nWhat is the car model? , Corvette, Focus, Ranger etc...");
carModel = Console.ReadLine();
Console.WriteLine("\nWhat is the colour of the car?");
carColour = Console.ReadLine();
Console.WriteLine("\nWhat is the engine size? eg 1.2");
carEngineSize = Decimal.Parse(Console.ReadLine());
Console.WriteLine("\nWhat is the car price?");
carPrice = int.Parse(Console.ReadLine());
Car newCar = new Car(carMake, carModel, carColour, carEngineSize, carPrice);
Console.WriteLine("\nyou chose to add a car to your shopping cart");
Console.WriteLine("\nWhich item, would you like to buy? (number)");
int carChosen = int.Parse(Console.ReadLine());
s.ShoppingList.Add(s.CarList[carChosen]);
Console.WriteLine("** EXCEPTION:\n" + ex + "**" + "\n\nError. Input was not of the range of cars expected. Please enter a number from the list of cars and try again\n");
Console.WriteLine("\nThe total cost of your items is : $" + s.Checkout());
private static void printShoppingCart(Store s)
Console.WriteLine("\nCars you have chosen to buy");
for (int i = 0; i < s.ShoppingList.Count; i++)
Console.WriteLine("\nCar # " + i + " " + s.ShoppingList[i]);
private static void printInventory(Store s)
for (int i = 0; i < s.CarList.Count; i++)
Console.WriteLine("\nCar # " + i + " \n" + s.CarList[i] + "\n");
static public int chooseAction()
Console.WriteLine("Choose an action: \n(0) to quit\n(1) to add a new car to inventory\n(2) add car to cart\n(3) to checkout");
choice = int.Parse(Console.ReadLine());
Console.WriteLine("Please enter a numeric value");
static public int chooseActionPaulStyle()
Console.WriteLine("Choose an action: \n(0) to quit\n(1) to add a new car to inventory\n(2) add car to cart\n(3) to checkout");
if (int.TryParse(Console.ReadLine(), out choice))