An automobile dealership uses CODE = 1 for new automobiles, CODE = 2 for used automobiles, and CODE = 3 for separate accessories. A salesman’s commissions are as follows: on new automobile, 3% of the selling price but a maximum of $300; on used automobile, 5% of the selling price but with a minimum of $75; on accessories, 6% of selling price.

1.Draw a flowchart that inputs CODE and PRICE and outputs COMMISSION.
2.Write a pseudocode programme that inputs CODE and PRICE and outputs COMMISSION.

1. Here is a flowchart that inputs CODE and PRICE and outputs COMMISSION:

```plaintext
Start
|
V
Input CODE and PRICE
|
V
If CODE is 1
|
V
COMMISSION = minimum(3% of PRICE, $300)
|
V
If CODE is 2
|
V
COMMISSION = maximum(5% of PRICE, $75)
|
V
If CODE is 3
|
V
COMMISSION = 6% of PRICE
|
V
Output COMMISSION
|
V
End
```

2. Here is a pseudocode program that achieves the same functionality:

```plaintext
Start
|
Input CODE
Input PRICE
|
If CODE is 1
|
COMMISSION = minimum(0.03 * PRICE, 300)
|
Else If CODE is 2
|
COMMISSION = maximum(0.05 * PRICE, 75)
|
Else If CODE is 3
|
COMMISSION = 0.06 * PRICE
|
End If
|
Output COMMISSION
|
End
```

In the pseudocode program, we use the notation `0.03` to represent 3%, `0.05` to represent 5%, and `0.06` to represent 6% of the selling price. The `minimum(...)` function returns the smallest value between two values, and the `maximum(...)` function returns the largest value between two values.

Flowchart:

Here is a flowchart that inputs CODE and PRICE and outputs COMMISSION:

```
START
Input CODE
Input PRICE

// Check the CODE
IF CODE = 1 THEN
// Calculate commission for new automobile
Commission = 3% of PRICE
IF Commission > 300 THEN
Commission = 300
ENDIF
ELSE IF CODE = 2 THEN
// Calculate commission for used automobile
Commission = 5% of PRICE
IF Commission < 75 THEN
Commission = 75
ENDIF
ELSE IF CODE = 3 THEN
// Calculate commission for accessories
Commission = 6% of PRICE
ENDIF

Output COMMISSION
END
```

Pseudocode:

Here is a pseudocode program that inputs CODE and PRICE and outputs COMMISSION:

```
START
INPUT CODE
INPUT PRICE

// Check the CODE
IF CODE = 1 THEN
// Calculate commission for new automobile
COMMISSION = 0.03 * PRICE
IF COMMISSION > 300 THEN
COMMISSION = 300
ENDIF
ELSE IF CODE = 2 THEN
// Calculate commission for used automobile
COMMISSION = 0.05 * PRICE
IF COMMISSION < 75 THEN
COMMISSION = 75
ENDIF
ELSE IF CODE = 3 THEN
// Calculate commission for accessories
COMMISSION = 0.06 * PRICE
ENDIF

OUTPUT COMMISSION
END
```