003-004-007

Compound Assignment: Price with Tax

Easy

Problem Description

Compound Assignment: Price with Tax

In this problem, you will create a program that reads a pre-tax price, uses the compound assignment operator (+=) to add 10% consumption tax, and displays the pre-tax price, tax amount, and total price on three separate lines to standard output.

Learning Objective: Learn to calculate price with tax by combining compound assignment operators (+=) with arithmetic operations

Calculate price including tax. Add 10% consumption tax to pre-tax price to get the total.

Input

Line 1: Pre-tax price (integer)

Output

Pre-tax: [price] yen
Tax: [tax] yen
Total: [total] yen

Ready to Try Running Code?

Log in to access the code editor and execute your solutions for this problem.

Don't have an account?

Sign Up