003-004-002

Compound Assignment: Price with Tax

Easy

Problem Description

Compound Assignment: Price with Tax

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

Test Cases

※ Output examples follow programming industry standards

Input:
1000
Expected Output:
Pre-tax: 1000 yen
Tax: 100 yen
Total: 1100 yen
Input:
5000
Expected Output:
Pre-tax: 5000 yen
Tax: 500 yen
Total: 5500 yen
Input:
100
Expected Output:
Pre-tax: 100 yen
Tax: 10 yen
Total: 110 yen
❌ Some tests failed
❌ エラー発生

Your Solution

Current Mode: My Code
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here

sc.close();
}
}
0 B / 5 MB

You have 10 free executions remaining