Question: Write a program named Basic Pattern that prints the following pattern using a return method called printSymbol. The program should do the following tasks Sample
Write a program named Basic Pattern that prints the following pattern using a return method called printSymbol. The program should do the following tasks Sample 1 Sample 2 Sample 3 1 12 SS 123 S SS 1234 SSSS 1 2 3 4 5 SSSSS a. Write a method called printSymbol) which takes symbol and the number of rows to be printed as input parameters, then print out the pattern in sample 1. (2 marks) b. Write a method called printSymbol, which takes the number of rows to be printed as input parameter, then print out the pattern in sample 2. (2 marks) c. Display sample 1, when you invoke the method as printSymbol(", 5), (1 mark) display sample 2 when you invoke the method as printSymbol( 5 ) and display sample 3 when you invoke method printSymbol('S', 5)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
