To solve this optimization problem, we will first define the decision variables and the objective function. Let's denote the number of hardwood flooring installations as $H$ and the number of carpet installations as $C$. The objective is to maximize profit, which can be represented by the equation $400H + 650C$, given the constraints on cutting and installation hours.

The company has two main constraints:
1. Cutting time: $1H + 0.5C \leq 200$
2. Installation time: $3H + 4C \leq 400$

Both $H$ and $C$ must be non-negative since the company cannot install a negative number of flooring.

Here's how we can translate this problem into Gurobi code in Python:

```python
from gurobipy import *

# Create a new model
m = Model("Flooring_Optimization")

# Define the decision variables
H = m.addVar(vtype=GRB.CONTINUOUS, name="Hardwood_Flooring", lb=0)
C = m.addVar(vtype=GRB.CONTINUOUS, name="Carpet", lb=0)

# Set the objective function to maximize profit
m.setObjective(400*H + 650*C, GRB.MAXIMIZE)

# Add constraints for cutting and installation time
m.addConstr(H + 0.5*C <= 200, "Cutting_Time")
m.addConstr(3*H + 4*C <= 400, "Installation_Time")

# Optimize the model
m.optimize()

# Print out the results
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Hardwood Flooring: {H.x}")
    print(f"Carpet: {C.x}")
    print(f"Maximum Profit: ${400*H.x + 650*C.x:.2f}")
else:
    print("No optimal solution found.")
```