002-003-006

Numeric Input: Test Score Input

Easy

Problem Description

Numeric Input: Test Score Input

In this problem, you will create a program that reads a subject name and score using Scanner's next() and nextInt() methods, then displays them in a specified format to standard output.

Learning Objective: Input multiple integers with nextInt()

In a test score management program, input subject and score to display them.
Practice inputting multiple numbers in sequence.

Input

Line 1: Subject (string)
Line 2: Score (integer)

Output

================================
     Test Result
================================
Subject: [subject]
Score: [score] pts
================================

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