008-003-004

Method Call: Calculator Class

Easy

Problem Description

Method Call: Calculator Class

Learning Objective

Learn how to call one method from another method.

Problem

Create a program that inputs two numbers and displays both sum and product results.
Call add and multiply methods from the calculate method.

Input

Line 1: First number (integer)
Line 2: Second number (integer)

Output

Sum: [sum]
Product: [product].

Test Cases

※ Output examples follow programming industry standards

Input:
3
4
Expected Output:
Sum: 7
Product: 12
Input:
5
2
Expected Output:
Sum: 7
Product: 10
❌ 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 9 free executions remaining