008-005-002
Reference Type Parameter Method: String Decorator
Easy
Problem Description
Reference Type Parameter method: String Decorator
In this problem, you will create a program that defines a decorate method taking a String parameter, adds ★ decorations before and after the input string, and displays the result to standard output.
Learning Objective: Define methods with reference type parameters
Create a program that displays a decorated string. Pass the string to the decorate method to add ★ symbols before and after it.
Input
Line 1: String
Output
★ [string] ★
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
Congratulations
Expected Output:
★ Congratulations ★
Normal case
Input:
Complete
Expected Output:
★ Complete ★
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
