'Possible class issue Stack Overflow Exception

This is my first year working with C#. VS is not showing any errors but I am getting a stack overflow exception when I run it. Half of the code executes as intended so I'm guessing the issue is in the classes. I am just unsure what the issue is. Any help would be appreciated.

The overall instruction for this project is: Write an application for Nina’s Cookie Emporium named CookieDemo that declares and demonstrates objects of the CookieOrder class and its descendants. The CookieOrder class includes the following auto-implemented properties:

OrderNum - The order number Name - The recipient’s name CookieType - The cookie type (for example, chocolate chip) The class should also include fields for number of dozens ordered and price (named Dozens and Price). When the field value for number of dozens ordered is set, the price field is set as $15 per dozen for the first two dozen and $13 per dozen for each dozen over two.

Next, create a child class named SpecialCookieOrder, which includes a field with a description as to why the order is special (for example, gluten-free). Override the method that sets a CookieOrder’s price as described in the step above, but also to include special handling, which is $10 for orders up to $40 and $8 for higher-priced orders.

An example of the program is shown below:

Order #101 Arthur
type: gluten-free chocolate chip 1 dozen --- $25 Order #102 Brown
type: sugar-free peanut butter 2 dozen --- $40 Order #103 Cooper
type: iced sugar 3 dozen --- $51

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;

namespace _10_4_Prgm
{
    internal class Program
    {
        static void Main(string[] args)
        {
            CookieOrder aCookieOrder = new CookieOrder();
            SpecialCookieOrder aSpecialCookieOrder = new SpecialCookieOrder();
            WriteLine("Input Order Number");
            aCookieOrder.OrderNum = Convert.ToInt32(ReadLine());
            WriteLine("Input Name");
            aCookieOrder.Name = ReadLine();
            WriteLine("Input Cookie Type");
            aCookieOrder.CookieType = ReadLine();
            WriteLine("Input how many dozens");
            aCookieOrder.Dozens = Convert.ToInt32(ReadLine());
            WriteLine(aSpecialCookieOrder.SpecialDescription);
        }
    }

public class CookieOrder
{
    private const int PPD1 = 15;
    private const int PPD2 = 13;
    public int orderCost;
    public string specialDescription;

    public int OrderNum { get; set; }
    public string Name { get; set; }
    public string CookieType { get; set; }

    public int OrderCost
    {
        get
        {
            return orderCost;
        }
        set
        {
            if (Dozens <= 2)
            {
                orderCost = PPD1 * Dozens;
            }
            else
            {
                orderCost = PPD2 * Dozens;
            }
        }
    }

    public int Dozens
    {
        get;

        set;
    }

}

public class SpecialCookieOrder : CookieOrder
{
    public string SpecialDescription
    {
        get
        {
            return specialDescription;
        }

        set
        {
            WriteLine("Order #{0}       {1} /n    type: {2} /n    {3} dozen --- {4:c2}", OrderNum, Name, CookieType, Dozens, OrderCost);
        }
    }
}

}



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source