C# Case Study

Pizza Order Form — Customer & Pricing Logic

A Windows Forms application that collects customer details, supports pickup or delivery, and calculates total price based on crust type, size, cheese options, and toppings. The final order summary is displayed so the customer can confirm the details.

Screenshots

Code-Behind

Screenshot of Pizza order form C# code-behind.

Event handlers and pricing logic that respond to radio buttons, checkboxes, and text fields.

Form Designer

Screenshot of Pizza order form designer code in C#.

Designer-generated layout code structuring the customer information and pizza configuration sections.

Completed Order Example

Pizza order form with example values showing final order summary and total.

An example test run that shows a full order with delivery, toppings, and calculated total price.

Project Overview

This assignment expanded on basic Windows Forms skills by combining user input, conditional UI, and pricing logic into a single form. The app collects the customer's name and, if delivery is selected, prompts for address and phone number. It then allows the user to configure the pizza: pickup or delivery, crust type, size, cheese options, and toppings.

Once the choices are made, the application calculates the total price and displays an order summary. This provides a simple but realistic flow for ordering a pizza and demonstrates how UI controls and business logic can work together.

Key Logic (Order Summary & Pricing)

A simplified example of how the total and summary might be built:

private void btnPlaceOrder_Click(object sender, EventArgs e)
{
    decimal total = 0m;

    // Base price from size
    if (radSmall.Checked)  total += SMALL_PRICE;
    if (radMedium.Checked) total += MEDIUM_PRICE;
    if (radLarge.Checked)  total += LARGE_PRICE;

    // Crust and toppings
    if (radDeepDish.Checked) total += DEEP_DISH_UPCHARGE;

    if (chkPepperoni.Checked) total += TOPPING_PRICE;
    if (chkMushrooms.Checked) total += TOPPING_PRICE;
    if (chkOnions.Checked)    total += TOPPING_PRICE;

    // Delivery charge
    bool isDelivery = radDelivery.Checked;
    if (isDelivery)
        total += DELIVERY_FEE;

    string summary = $"Customer: {txtName.Text}\n" +
                     $"Type: {(isDelivery ? "Delivery" : "Pickup")}\n" +
                     $"Total: {total:C}";

    txtSummary.Text = summary;
}

The actual project uses the specific controls defined on the form, but the idea is the same: determine a base price from size and crust, add charges for toppings and delivery, then present a readable order summary.

What I Learned

Explore the Code

You can review the full implementation, including all controls, validation, and pricing logic, in the GitHub repository.