Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve the problem using Java programming language Problem: Darth Vader wants to check that his TIE fighter pilots are patrolling adequately-sized regions of the galaxy.

Solve the problem using Java programming language

Problem: Darth Vader wants to check that his TIE fighter pilots are patrolling adequately-sized regions of the galaxy. He has files of data that contain the patrol coordinates for each of his pilots. With the fear of being force choked, you have agreed to write a program that analyzes the data and determines the size of the area patrolled by the pilots. Details:

The area of the shape can be calculated with the following formula:

image text in transcribed The vertices will be stored in a 3-dimensional array o The dimensions are 20 x 16 x 2 o The first dimension is pilot o The second dimension is coordinate o The third dimension is x or y value

A single dimension array will be needed to store pilot names The entire file will be read and stored in the appropriate array before performing calculations (-15 points) The maximum number of pilots is 20 The maximum number of coordinates on a line is 16 The last coordinate on the line will be the same as the first The program must have a least 3 functions. o At least 2 of the functions must be called from main Input: All input will come from a file named pilot_routes.txt. The file will contain the pilots first name followed by a list of coordinates separated by spaces. Each line in the file will represent a different pilot. The format for each line will be the pilots first name followed by a list of x and y coordinates. There will be a space between each pair of coordinates and a comma between the x and y coordinates. The first and last set of coordinates will always be the same. There may or may not be a new line character at the end of the last line in the file. Output: All output will be written to a file named pilot_areas.txt. Output file format o The area should be rounded to 2 decimal places. Each pilots data will be written on a separate line. Sample Input Line: Greedo 4,0 4,7.5 7,7.5 7,3 9,0 7,0 4,0 Sample Output Line: Greedo 25.50

n-2 14 0

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

Master The Art Of Data Storytelling With Visualizations

Authors: Alexander N Donovan

1st Edition

B0CNMD9QRD, 979-8867864248

More Books

Students also viewed these Databases questions

Question

What are oxidation and reduction reactions? Explain with examples

Answered: 1 week ago

Question

1. Identify three approaches to culture.

Answered: 1 week ago

Question

2. Define communication.

Answered: 1 week ago