Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me to solve the problem with java language! Application that can read text files containing lists of points in a two-dimensional space and

Please help me to solve the problem with java language!

Application that can read text files containing lists of points in a two-dimensional space and display those points in a graphics window. The points will be provided as pairs of numbers (integer or floating-point) representing the X (horizontal) and Y (vertical) positions in a Cartesian coordinate system. The first line of the text file will be an integer indicating the number of point positions, N. The next N lines will be a pair of values (one point per line), each value preceded by zero or more spaces with the two values separated by a comma, as shown here:

5 -2, -5 0, 0 5, 60 10, -15 24, 42 

Your program must be able to accomplish the following operations:

  1. Read the text file. The user will be allowed to specify the file name and file path in one of the following ways:
    • As a command-line argument
    • By using a "File Open" dialog box
  2. Display the points. The program will read the point set, determine an appropriate scale, and display the points in a graphics window.
  3. Draw line segments between the points in the order that they appear in the text file.

For example, given the input file shown above, the output of the program could be displayed as follows:

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle PL/SQL Programming Database Management Systems

Authors: Steven Feuerstein

1st Edition

978-1565921429

More Books

Students also viewed these Databases questions

Question

7. Identify four antecedents that influence intercultural contact.

Answered: 1 week ago

Question

5. Describe the relationship between history and identity.

Answered: 1 week ago