Write a program   that reads the subtotal and the gratuity rate in this order, then computes the gratuity and total.

For example, if the user enters "10" for subtotal and "15" (%) for gratuity rate, the program   displays "1.5" as gratuity and "11.5" as total.

Display only the numerical results in each line and nothing else.

84.523

To write a program that calculates the gratuity and total based on the subtotal and gratuity rate, you can follow these steps:

1. Prompt the user to enter the subtotal.
2. Read the subtotal value from the user.
3. Prompt the user to enter the gratuity rate percentage.
4. Read the gratuity rate value from the user.
5. Calculate the gratuity amount by multiplying the subtotal with the gratuity rate percentage divided by 100.
6. Calculate the total by adding the subtotal and the gratuity amount.
7. Display the gratuity amount and total on separate lines.

Here's the program code in Python:

```python
# Step 1: Prompt for subtotal
subtotal = float(input("Enter the subtotal: "))

# Step 3: Prompt for gratuity rate
rate = float(input("Enter the gratuity rate (%): "))

# Step 5: Calculate gratuity
gratuity = subtotal * (rate / 100)

# Step 6: Calculate total
total = subtotal + gratuity

# Step 7: Display results
print("Gratuity: ", gratuity)
print("Total: ", total)
```

When you run this program and provide the input for the subtotal and gratuity rate as mentioned in your example (10 and 15), it will display the gratuity (1.5) and the total (11.5) as output.