Question: and if you get 4 as input, you'll output: A way the Triangle class can look is as follows, however you are in no way

 and if you get 4 as input, you'll output: A waythe Triangle class can look is as follows, however you are inno way obligated to follow this. The other classes will also looklike this one. public class Triangle { private int length; public Triangle(intlength); public String printShape(); The Rectangle class will represent rectangles with twonumbers representing the width and the height. ** ** ** and arectangle given 3 and 2 will look like: The Rhombus class willrepresent a rhombus with a single number indicating the height. See figurefor explanation. and if it's 7 it should look like: *lthk ************ ***** *** * note that an even number will not workfor this shape, so such if a rhombus if an even numberis supplied to its constructor an "IllegalArgumentException\" should be thrown. The asterisksshould also be padded like the examples. Recursion Each class should implementa recursive getShapel} method (similar to the getAreal) method in the lectureslides). The method will return a String containing the shape in aform similar to the gures in this assignment. JUn it Testing After

and if you get 4 as input, you'll output: A way the Triangle class can look is as follows, however you are in no way obligated to follow this. The other classes will also look like this one. public class Triangle { private int length; public Triangle(int length); public String printShape(); The Rectangle class will represent rectangles with two numbers representing the width and the height. ** ** ** and a rectangle given 3 and 2 will look like: The Rhombus class will represent a rhombus with a single number indicating the height. See figure for explanation. and if it's 7 it should look like: *lthk ***** ******* ***** *** * note that an even number will not work for this shape, so such if a rhombus if an even number is supplied to its constructor an "IllegalArgumentException\" should be thrown. The asterisks should also be padded like the examples. Recursion Each class should implement a recursive getShapel} method (similar to the getAreal) method in the lecture slides). The method will return a String containing the shape in a form similar to the gures in this assignment. JUn it Testing After the classes and methods are made, you should make sure they will have the correct expected output. Make sure you test for edge cases, namely massive numbers, small numbers, and anything that might break your program. Make sure you also test every class, and each method that's being tested must be called at least 3 times per test, with different parameters each time. Note that no files should be read/written to when testing your functions. File l/O Your program should take in input from the files on Canvas, which will have the .in extensions. Furthermore, your program should also output to les with the same name of the input file, but with the .out extension, provided the input file is in the correct format. We recommend that you make one method that will parse the file and handle its inputs and takes in a "File\" as a parameter, and another that will read the le. Exception handling Some of the input files will be in the wrong format, and your program will not be able to handle them. You should catch these exceptions and tell the user that an exception has occurred, as well as NOT outputting to a file. Your program MUST handle two exceptions, a FileNotFound Exception, and an |IlegaIArgumentException. Learning Objectives After completing this assignment, students will understand the function of Objects, File IIO, exception handing, .IUnit testing, and recursion. Summary The gist of this assignment document's contents are as follows: ' Program Description: Reading shape specications from les and printing them out ' Hints, edge-cases, and design considerations o You have 10 files as input and you must use all of them 0 You should have files outputted 0 You should have at least 3 classes by the end of the program Deliverables Si Reminders 0 Use a project named Assignments and create a different java file for each class. Files must be named according to the shape. For example, a le containing the Triangle class should be named "Triangle.jaya". 0 Submit a .zip le that is your compressed project folder. Rubric Visible on Canvas Assignment Page Sample Program Output Changelonglari cations Program Description For this assignment, you will write a program to print three shapes of different sizes. Your program will read Input from a text file and write the output to another file. The input files should be saved in a subfolder called InputFiles while the output les should be written to a subfolder called OutputFiles. Both InputFlles and OutputFlles subfolders should be under the project's main {older This assignment is divided up into ve main parts we want you to be able to handle, objects, recursion, JUnit testing, file 11'0. and exception handling. The sections are in the order I'd recommend you implement them in, however do what will make the most sense to you. Objects Create four classes; Triangle, Rectangle and Rhombus and a File Handler class A Triangle will be supplied one integer which will dictate how far "down" you want to go. For example, if you're given the integer 5, you'll get the output: InputFiles > E biginput1.in Project bigInput1.in X Project InputFiles ~/Downloads/InputFiles 1 rhombus 3 > .idea N rhombus 5 bigInput1.in CN rectangle 2 4 biginput2.in rectangle 4 2 bigShapes.in 5 triangle 3 greatestToLeast.in mixedShapes1.in triangle 5 7 mixedShapes2.in rectangle 5 2 rectangles.in 8 rectangle 3 5 rhombi.in 9 rhombus 7 sampleTest.in 10 triangle 9 triangles.in 11 rectangle 4 2 lilli External Libraries 12 triangle 5 Scratches and Consoles 13 rectangle 2 4 14 rectangle 4 2 15 triangle 9 16 rhombus 3 17 rhombus 5 18 rectangle 2 3 19 triangle 2 20 rhombus 11 StructureInputFiles biginput2.in Project bigInput1.in X Project V InputFiles ~/Downloads/InputFiles 1 rhombus 3 .idea 2 rhombus 5 = bigInput1.in 3 rectangle 2 4 bigInput2.in 4 rectangle 4 2 = bigShapes.in 5 triangle 3 = greatestToLeast.in 6 mixedShapes1.in triangle 5 mixedShapes2.in 7 rectangle 5 2 rectangles.in 8 rectangle 3 5 rhombi.in 9 rhombus 7 = sampleTest.in 10 triangle 9 triangles.in 11 rectangle 4 2 lilli External Libraries 12 triangle 5 Scratches and Consoles 13 rectangle 2 4 14 rectangle 4 2 15 triangle 9 16 rhombus 3 17 rhombus 5 18 rectangle 2 3 19 triangle 2 20 rhombus 11InputFiles > E biginput2.in Project a - bigInput2.in X Project InputFiles ~/Downloads/InputFiles rhombus 5 .idea rectangle 4 2 bigInput1.in 3 triangle 3 bigInput2.in 4 triangle 9 bigShapes.in 5 rectangle 3 2 greatestToLeast.in 6 mixedShapes1.in rhombus 3 mixedShapes2.in 7 rhombus 9 rectangles.in 8 rectangle 2 4 rhombi.in 9 triangle 9 sampleTest.in 10 triangle 8 triangles.in 11 octagon 5 lilli External Libraries 12 rectangle 3 5 Scratches and Consoles 13 square 4 14 rhombus 9 15 rectangle 5 2 16 rhombus 3 17 triangle 3 18 triangle 2 19 triangle 6 20 rectangle 4 3\fInputFiles ) E greatestToLeast.in Project bigInput2.in X bigShapes.in X greatestToLeast.in X Project InputFiles ~/Downloads/InputFiles rhombus 5 > .idea 2 rhombus 4 = biginput1.in 13 rhombus 3 =bigInput2.in 4 rhombus 2 bigShapes.in 5 rhombus 1 greatestToLeast.in 6 =mixedShapes1.in rectangle 5 5 7 mixedShapes2.in rectangle 4 5 rectangles.in 8 rectangle 3 5 rhombi.in 19 rectangle 2 5 sampleTest.in 10 rectangle 1 5 triangles.in 11 triangle 5 lilli External Libraries 12 triangle 4 Scratches and Consoles 13 triangle 3 14 triangle 2 15 triangle 1\f\f\f\f\fIntelliJ IDEA File Edit View Navigate Code Refactor Build Run Tools VCS Window Help G InputFiles - triangles.in Proje InputFiles ~/Downloads/InputFiles triangle 3 .idea 2 triangle 2 = bigInput1.in 3 triangle 4 bigInput2.in = bigShapes.in = greatestToLeast.in = mixedShapes1.in mixedShapes2.in rectangles.in rhombi.in sampleTest.in triangles.in IIll External Libraries Scratches and Consoles

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!