I have an unfinished java class, I need to write 4 methods there 1st step : create a file reader that reads the shape files supplied to you. Eachline of the shape file specifies a shape. The format of this line differs depending on the shape ( files supplied to me : ExampleShapes.txt, TwoRedCircles.txt, and ExampleShapesStill.txt) step 2 : I would start by trying to read a single line of the file followed by multiple lines, printing them to the screen to ensure you are reading the data correctly. Then, cre- ate instances of the shape objects and print them out. You can do this by calling the toString() method that has already been given to you. step 3: If the file does not exist, quit the program grace- fully and output Could not find to the screen (standard out) with re- placed by the file that will not open. However, you can assume that each line of the file has the cor- rect syntax. To test your code, please try to run the TwoRedCircles.txt file. step 4: Start by printing out each line your read to the terminal to make sure you are reading the data correctly. Then, create instances of the objects and use the toString() method to print out the object and make sure that it is being cre- ated correctly.
Reposting as I was getting the wrong answers!!! Java only and please read the description
I have an unfinished java class, I need to write 4 methods there
1st step : create a file reader that reads the shape files supplied to you. Eachline of the shape file specifies a shape. The format of this line differs depending on the shape ( files supplied to me : ExampleShapes.txt, TwoRedCircles.txt, and ExampleShapesStill.txt)
step 2 : I would start by trying to read a single line of the file
followed by multiple lines, printing them to the screen
to ensure you are reading the data correctly. Then, cre-
ate instances of the shape objects and print them out.
You can do this by calling the toString() method
that has already been given to you.
step 3: If the file does not exist, quit the program grace-
fully and output Could not find <filename>
to the screen (standard out) with <filename> re-
placed by the file that will not open. However, you
can assume that each line of the file has the cor-
rect syntax. To test your code, please try to run the
TwoRedCircles.txt file.
step 4: Start by printing out
each line your read to the terminal to make sure you
are reading the data correctly. Then, create instances
of the objects and use the toString() method to
print out the object and make sure that it is being cre-
ated correctly.
Step by step
Solved in 2 steps with 3 images