Creation of a Catapult Contest. Must be an OOP Design [Catapult.java & CatapultTester.java]. The program will create a Catapult object that will create a searchable matrix of trajectories for the...


Creation of a Catapult Contest.



Must be an OOP Design [Catapult.java & CatapultTester.java].


The program will create a Catapult object that will create a searchable matrix of trajectories for the given speeds and angles. The object should store these values in a 2D array. Given a target range of minimum and maximum distances, representing the near and far castle walls, the program should search the calculated trajectories and return a list of speed and angle combinations that can be used by your team to successfully launch the catapult. The output should be in an easy to read human readable format. If there are no speed and angle pairs in the current set that will accomplish the goal in the current matrix, the program should also graciously tell the users that they do not have a viable launch. The program will have a number of potential sets of speeds and angles. The program should be able to run the simulation as many times as indicated by the user (found in the text file). Input will be done from a text file rather than keyboard input.


The program will take input from a text file containing the following information on each line:


Number of sets


Number of speeds, followed by a list of speeds


Number of angles, followed by a list of angles


Minimum trajectory


Maximum trajectory


**speeds, angles, maximum and minimum repeated for the specified number of sets



Expected Output:


When your program runs correctly, the program should output a table of possible distance values and under the table there should be a list of the speed and angle pairs that match. Note, there will be a series of projectile tables in the output – one for each of the tests. When the program is run, there should be a projectile table and a set of best trajectory values for each set. If there are 7 sets of data, there should be 7 tables in the output. The image below is an example for 1 set of data. The format of the output table should resemble the following, but with the appropriate data for each row and column.



Requirements:


The program must utilize single dimensional arrays to store the speeds and angles. At a minimum, you will need one 2D array to store the values for the trajectories. How you define the logic and utilize these arrays is up to you.


The program must be created from an object-oriented perspective. Most of the work should be completed in the object class. The program must use methods appropriately. The final units should be in meters.



Text File Document Contents (Program will need to read from a text file):



[file attached as .png] - text file name is "catapult - test data.txt"

Jul 06, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here