002-001-004

Scanner Class: Product Order Input

Easy

Problem Description

Scanner class: Product Order Input

In this problem, you will create a program that reads a product name using Scanner.next() and a quantity using Scanner.nextInt(), then displays the order information to standard output.

Learning Objective: Learn to use multiple Scanner methods appropriately

Create a program that displays order information after entering product name and quantity.

Input

Line 1: Product name (string)
Line 2: Quantity (integer)

Output

Product: [product name]
Quantity: [quantity]

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