010-004-002
Method Overloading: Tax Calculation
Easy
Problem Description
Method Overloading: Tax Calculation
Learning Objective: Use overloading to provide same functionality for different input types
Implement tax calculation methods for different data types (int, double, String) using overloading. Implement calculation processing for each type. Tax rate is 10%.
Input
None (use fixed values)
Output
Tax included(int): [result] yen
Tax included(double): [result] yen
Tax included(String): [result] yen
```java
## Examples
### Example 1: Basic values
Output:
```java
Tax included(int): 1100 yen
Tax included(double): 1100.55 yen
Tax included(String): 3299 yen
```java
### Example 2: Different values
Output:
```java
Tax included(int): 5500 yen
Tax included(double): 2200.0 yen
Tax included(String): 880 yen
```java
### Example 3: Boundary values
Output:
```java
Tax included(int): 0 yen
Tax included(double): 0.11 yen
Tax included(String): 11000 yen
Test Cases
※ Output examples follow programming industry standards
Input:
Expected Output:
Tax included(int): 1100 ¥ Tax included(double): 1100.5500000000002 ¥ Tax included(String): 3298 ¥
Input:
Expected Output:
Tax included(int): 1100 ¥ Tax included(double): 1100.5500000000002 ¥ Tax included(String): 3298 ¥
Input:
Expected Output:
Tax included(int): 1100 ¥ Tax included(double): 1100.5500000000002 ¥ Tax included(String): 3298 ¥
❌ Some tests failed
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 9 free executions remaining
