public float GetExpenses() { float amount = 0; foreach (KeyValuePair<Ship, int> ship in ships) { amount += ship.Key.Maintenance * ship.Value; } return amount; }