Task: Given input file A, translate the content to produce output file B
Hi there,

I need help in solving this domain problem. Any help will be appreciated.

====Scenario==========
File A: Consists of multiple lines of data whereby each line is of form
X;1.9,2;3,4.3; 5,6

Output file B, should consists of one line per shape and should be formatted as follows.
Shape[TRIANGLE], Points[[[3.0,3.0], [5.0, 8.0], [8.0,4.0]]], Area[9.0]

This should be supporting 4 shape types: Circle, Square, Triangle, Rectangle.

This should demonstrate OO principle and use Factory design patten and Unit tests.

Note: Input File A has these cartisean coordinates which have to be read and determine the shape type;

t: 3,3; 5,8; 7,4
s:-1,-6; -1,-3; 2, -3; -2, -6
c: -4, -3; -2,-1
r:-1,1;4,1; -5; -1,-5

Recommended Answers

All 3 Replies

What do you not understand? The first letter is obviously the shape, and the points are on a grid. So figure out the lengths of the sides/radius and do the multiplication work. We are not going to do your homework for you.

What do you not understand? The first letter is obviously the shape, and the points are on a grid. So figure out the lengths of the sides/radius and do the multiplication work. We are not going to do your homework for you.

Hello,
Thanks for your reply. I am trying to improve myself in java as a whole. This is not a work which need to be submitted for any personal gain. I, therefore can calculate the area of all the shapes, but when it comes to determine the shape type I am stuck. Also, it will benifit me to see how other people attemp this problem. Any help is much appreciated.

Like I said, the first letter, obviously, identifies the shape.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.