003-001-007

Arithmetic Operators: Shopping Total Calculation

Easy

Problem Description

Arithmetic Operators: Shopping Total Calculation

In this problem, you will create a program that reads two item prices using Scanner, calculates the total using the addition operator (+), and displays each item's price and the total to standard output.

Learning Objective: Learn to add multiple item prices using the addition operator (+) to calculate the total amount

Calculate the total shopping amount. Input prices of 2 items and display the total.

Input

Line 1: Item 1 price (integer)
Line 2: Item 2 price (integer)

Output

Item 1: [price1] yen
Item 2: [price2] yen
Total: [price1+price2] 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