## Problem Description and Formulation

The company needs to decide how many cars and buses to wash in order to maximize earnings, given the constraints on watering time and soap availability.

Let's define the decision variables:
- \(x\): the number of cars to be washed
- \(y\): the number of buses to be washed

The objective function to maximize earnings is:
\[ \text{Maximize:} \quad 50x + 75y \]

Subject to the constraints:
1. Watering time constraint: \( 30x + 50y \leq 5000 \)
2. Soap cost constraint: \( 10x + 20y \leq 1500 \)
3. Non-negativity constraints: \( x \geq 0, y \geq 0 \)

## Gurobi Code

```python
import gurobi

def solve_washing_problem():
    # Create a new model
    model = gurobi.Model()

    # Define the decision variables
    x = model.addVar(lb=0, vtype=gurobi.GRB.CONTINUOUS, name="cars")
    y = model.addVar(lb=0, vtype=gurobi.GRB.CONTINUOUS, name="buses")

    # Define the objective function
    model.setObjective(50*x + 75*y, gurobi.GRB.MAXIMIZE)

    # Add the watering time constraint
    model.addConstr(30*x + 50*y <= 5000, name="watering_time")

    # Add the soap cost constraint
    model.addConstr(10*x + 20*y <= 1500, name="soap_cost")

    # Optimize the model
    model.optimize()

    # Check if the model is optimized
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal solution: cars = {x.varValue}, buses = {y.varValue}")
        print(f"Maximum earnings: ${model.objVal:.2f}")
    else:
        print("The model is infeasible or unbounded.")

solve_washing_problem()
```

This code defines the optimization problem using Gurobi's Python interface, solves it, and prints out the optimal solution and the maximum earnings if the problem is feasible and has an optimal solution.