Solution: E-Commerce Shipping Calculator

Review the implementation of inheritance, virtual method overriding, and base class execution.

Solution: E-Commerce Shipping Calculator

Review the implementation of inheritance, virtual method overriding, and base class execution.
C# 14.0
namespace Retail;
public class PostalShipment
{
public double WeightInPounds { get; init; }
public virtual decimal CalculateCost()
{
return 5.00m + (decimal)(WeightInPounds * 0.5);
}
}
public class ExpressShipment : PostalShipment
{
public override decimal CalculateCost()
{
return base.CalculateCost() + 10.00m;
}
}