Could anyone please solve this java programming problemq\'s Write a method that
ID: 3613256 • Letter: C
Question
Could anyone please solve this java programming problemq'sWrite a method that takes two integer parameters, and prints out arectangle of stars
whose width and height correspond to the first and secondparameters. For example, if
the first parameter is 3, and the second parameter is 5, then yourmethod should print the
following:
***
***
***
***
***
Hints:
· System.out.print(“*”); is used to print asingle star, but stay on the same line
(notice there is no ln after print)
· System.out.println(); is used to start printing on thenext line (like pressing
ENTER on the keyboard)
· A loop can be used to print a row of stars. The number oftimes this loop repeats
depends on the parameter value
· You should put this loop inside another loop. This outerloop will print many
rows, because it is repeating the action of printing just one rowof stars.
I really appreciate any of this q's answer
Thank you so much
Explanation / Answer
import java.io.*; import java.util.*; import java.lang.*; public class Star { public static void printStars(int a, int b) { for(int i=0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.