Problem 167751 · easy · Phase 01 Prerequisites & Setup

Receipt Total with Tax

input · arithmetic · f-strings · rounding · type conversion

A shop receipt has one item. Read the unit price (a decimal number) on the first line and the quantity (a whole number) on the second line. Sales tax is 8% of the subtotal. Print three lines:

Subtotal: $<subtotal>
Tax: $<tax>
Total: $<total>

Every amount must be shown with exactly two decimal places.

Examples

Input:
12.50
3
Output:
Subtotal: $37.50
Tax: $3.00
Total: $40.50

Constraints

  • 0 <= price <= 10000, 0 <= quantity <= 1000

Goals

  • Convert input text to float and int
  • Compute a percentage of a value
  • Format money with exactly two decimals
Starting Python…