The goal for this exercise is to give you more opportunities to practice writing nested loops, using parameters, and using return value(s).
In the starter project, add code to the the Square_Of_Numbers_Parameters_Return
class, so that the
RunExercise
method will create an instance of the SquarePrinter
class.
You should then ask the user for the width and height of a rectangle to print.
The PrintRectangle method on the SquarePrinter
class (you will need to add and implement this method)
will print out a hollow rectangle of the height & width specified. This method must also
return the number of stars that were printed.
The RunExercise
method (and ONLY the RunExercise
method) will print out how many stars were printed.
Here's a sample transcript, with user input displayed like this:
Width? 5 Height? 4 ***** * * * * ***** Total number of stars: 14