002-003-002
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 the 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
================================
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
Math 85
Expected Output:
================================ Test Result ================================ Subject: Math Score: 85 pts ================================
Normal case
Input:
English 92
Expected Output:
================================ Test Result ================================ Subject: English Score: 92 pts ================================
Your Solution
Current Mode:● My Code
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
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
