Question
Use contructs and techniques to maximize the user friendliness and ease of troubleshooting. Follow all good programing technics. Use Java arrays, not ArrayList or any
Use contructs and techniques to maximize the user friendliness and ease of troubleshooting. Follow all good programing technics. Use Java arrays, not ArrayList or any other Java library collection classes. While not required, I would expect to see a full debug infrastructure...
It MUST =======
1 - Write a java class called Point to represent a N-Dimensional point (With coordinates that are double)
- The constructor should take any number of coordinates
- The class should have accessor method for any coordinates
- Write toString() and copy() and equals() helper methods
- Keep track of every created point
2 - Write a java class called Line to represent a line (with a starting point and an ending point)
- The constructor arguments are the start and end points
- The constructor MUST throw an error when the 2 points are not of the same dimension
- Write a toString() and copy() and equals() helper method
- Provide a getLineLength() method - Look up "Euclidian Distance" on wiki
- Keep track of every created line
3 - Write a tester class with main() to prompts and reads coordinates for 2 points from the user (CLI)
* Allow as many dimensions as the user wants for each point
* Allows abreviations for the random keyword and the exit keyword
* Allow user to request help - Allow the user to request a random value (See Math library, random() method)
- Created the 2 points
- Create a line with those two points
* If the contructor throws an exception, handle it with an appropriate message but do not abort the run...
- Display the starting / ending points and line length
- Loop and repeat step 3 until user request to exit
4 - When the user exits display final statistics:
* Number of points created * List all the points created
* Number of lines created
* List all the lines created
5 - Document test cases NOTE: Pay attention to details!!!!!!
You MUST use arrays and classes and helper methods and instanciate objects.
Example:
Enter point # 1 dimension # 1 or "Random" or "Exit" or "Help" or blank line to proceed: 3.14
Enter point # 1 dimension # 2 or "Random" or "Exit" or "Help" or blank line to proceed: 0
Enter point # 1 dimension # 3 or "Random" or "Exit" or "Help" or blank line to proceed:
Enter point # 2 dimension # 1 or "Random" or "Exit" or "Help" or blank line to proceed: 0
Enter point # 2 dimension # 2 or "Random" or "Exit" or "Help" or blank line to proceed: hEl *
This program allows you specify points in N-dimensional space:
- Each point can have different number of coordinate
- You may request a random number for any coordinate by typing "RANDOM"
- When you are finished entering the cordinate just press the key
* Pairs of point are used to create a lines
- If the 2 points have mismatched dimensions and error will be shown
- When a line is created, the line distance is provided
* When you are done specifying points and lines type "EXIT" to display final operation statistics
* All key words are case insensitive and can be abreviated
* Random number will be scaled between -1,000.00 and +1,000.00
Enter point # 2 dimension # 2 or "Random" or "Exit" or "Help" or blank line to proceed: 2.71
Enter point # 2 dimension # 3 or "Random" or "Exit" or "Help" or blank line to proceed: The distance between ( 3.14 , 0.0) and ( 0.0 , 2.71) is 4.147734321289154
Enter point # 1 dimension # 1 or "Random" or "Exit" or "Help" or blank line to proceed: Random --> -75.1234
Enter point # 1 dimension # 2 or "Random" or "Exit" or "Help" or blank line to proceed:
Enter point # 2 dimension # 1 or "Random" or "Help" or "Exit" or blank line to proceed: RA --> 38.12851983534693
Enter point # 2 dimension # 2 or "Random" or "Help" or "Exit" or blank line to proceed: rAnD --> 74.31366638262983
Enter point # 2 dimension #3 or "Random" or "Help" or "Exit" or blank line to proceed: Ouch - You tried to create a line with points of disimilar dimension!
Enter point # 1 dimension # 1 or "Random" or "Exit" or "Help" or blank line to proceed: EXIT You created 4 points: ( 3.14 , 0.0 ) ( 0.0 , 2.71 ) ( -75.1234 ) ( 38.12851983534693 , 74.31366638262983 ) You created 1 lines: ( 3.14 , 0.0 ) to ( 0.0 , 2.71 ) with length 4.147734321289154
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started