Question: Complete the following method that prints a right triangle made out of asterisks given a height and an output file name. You can assume that

Complete the following method that prints a right triangle made out of asterisks given a height and an output file name. You can assume that height will always be positive and all necessary imports have been made. The output file is also allowed to contain an empty trailing line. Sample output: printRightTriangle(5, "output") output contains: *** ***** ******* printRightTriangle(1, "output") output contains: public static __a__ printRightTriangle(int height, String outputFilename) throws _b__ { File outputFile = __C__; PrintWriter fileWriter __d__; int numAsterisks = -_e__; for (int currHeight 0; -_-_-; currHeight++) { for (int astCount = 0; -_9__; astCount++) { fileWriter.__h__; } fileWriter. i__ --_--; } fileWriter.flush(); // PrintWriter's close does not flush fileWriter.closeO
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
