Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java: Templates for the code: Projectile motion equations * = [vot *cos(0)] + xo y=[vo t sin(o)) - - ] + X: x displacement

In Java:
image text in transcribed
image text in transcribed
Templates for the code: image text in transcribed
image text in transcribed
Projectile motion equations * = [vot *cos(0)] + xo y=[vo t sin(o)) - - ] + X: x displacement Xo: initial x displacement Y: y displacement Yo: initial y displacement V. initial velocity t: time e initial angle g gravitational constant Keep in mind that the X and Y displacement is the distance from the projectiles origin at a given time stamp. See example below. Program Requirements: 1. The program shall use the first quadrant of a 2D coordinate plane. 2. The program shall have 2 projectiles named Hare and Hound 3. The program shall have the projectiles follow projectile motion equations. 4. The Hare shall have a random initial angle ranging from 0 to 90 degrees. 5. The Hare shall have a random initial velocity ranging from 70 to 120 meters per second 6. The Hare shall have a random initial height ranging from 400 to 1000 meters 7. The Hound shall have a random initial angle ranging from 0 to 90 degrees 8. The Hound shall have a random initial velocity ranging from 50 to 150 meters per second 9. The Hound shall have a starting height of 600 meters. 10. The Hare shall stop moving once it hits the ground 11. The Hound shall stop moving once it hits the ground 12. The program shall calculate the distance between the Hare and the Hound once they have both hit the ground 13. The program shall start both Hare and Hound on the left side of the screen (x = 0). 14. The program shall define ground as constant horizontal line. Homework Requirements: 1. The program shall run 2 iterations, 2. An Iteration shall consist of a. Setting up the Hare and hound (see Program Requirements 4-9) Homework Requirements: 1. The program shall run 2 iterations. 2. An Iteration shall consist of: a. Setting up the Hare and hound (see Program Requirements 4-9) b. Firing the Hare and Hound to follow projectile motion i. The program shall display the flight path in time intervals of 5 seconds c. Once the Hare and Hound hit the ground, the program shall display the distance between the Hare and the Hound 3. Iteration 1 shall have a ground shall defined as y+0. 4. Iteration 2 shall have a ground shall defined as y = 120. 5. The program shall have 2 classes Manager and Projectile 6. The Projectile class shall handle the location and movement. 7. The Manager class shall handle the 2 iterations using Projectile objects. public class Manager ( public static void main(String[] args) { //run each iteration } public static double randomFrom (int low int high) { //taken from lab 3/4 double randNum = 0; randNum - (Math.random(high-Low) return randum; + low): public static String distanceBetween(Projectile hare, Projectile hound) { 1/get the distance between the projectiles 3 public static void runIteration(int iterationum, int ground) { 1/create the projectiles with their randomized inputs System.out.println("Iteration iterationNum); W/start time System.out.println(" tare: "); 1/while the hare hasn't reached the ground, move it //restart time System.out.println(" Hound: ); //while the hound hasn't reached the ground. move it W/print out the distance between them } public class Projectile { //create attributes for the projectiles (take them from the hw doc) 1/don't forget to generate setters and getters //write the constructor so it takes in the inputs for each projectile and puts the //values in the right attributes public Projectile(/* inputs here...*/) { I } public void move(double time) { //just put the equations from the hw doc in here } //Setters and Getters... Projectile motion equations * = [vot *cos(0)] + xo y=[vo t sin(o)) - - ] + X: x displacement Xo: initial x displacement Y: y displacement Yo: initial y displacement V. initial velocity t: time e initial angle g gravitational constant Keep in mind that the X and Y displacement is the distance from the projectiles origin at a given time stamp. See example below. Program Requirements: 1. The program shall use the first quadrant of a 2D coordinate plane. 2. The program shall have 2 projectiles named Hare and Hound 3. The program shall have the projectiles follow projectile motion equations. 4. The Hare shall have a random initial angle ranging from 0 to 90 degrees. 5. The Hare shall have a random initial velocity ranging from 70 to 120 meters per second 6. The Hare shall have a random initial height ranging from 400 to 1000 meters 7. The Hound shall have a random initial angle ranging from 0 to 90 degrees 8. The Hound shall have a random initial velocity ranging from 50 to 150 meters per second 9. The Hound shall have a starting height of 600 meters. 10. The Hare shall stop moving once it hits the ground 11. The Hound shall stop moving once it hits the ground 12. The program shall calculate the distance between the Hare and the Hound once they have both hit the ground 13. The program shall start both Hare and Hound on the left side of the screen (x = 0). 14. The program shall define ground as constant horizontal line. Homework Requirements: 1. The program shall run 2 iterations, 2. An Iteration shall consist of a. Setting up the Hare and hound (see Program Requirements 4-9) Homework Requirements: 1. The program shall run 2 iterations. 2. An Iteration shall consist of: a. Setting up the Hare and hound (see Program Requirements 4-9) b. Firing the Hare and Hound to follow projectile motion i. The program shall display the flight path in time intervals of 5 seconds c. Once the Hare and Hound hit the ground, the program shall display the distance between the Hare and the Hound 3. Iteration 1 shall have a ground shall defined as y+0. 4. Iteration 2 shall have a ground shall defined as y = 120. 5. The program shall have 2 classes Manager and Projectile 6. The Projectile class shall handle the location and movement. 7. The Manager class shall handle the 2 iterations using Projectile objects. public class Manager ( public static void main(String[] args) { //run each iteration } public static double randomFrom (int low int high) { //taken from lab 3/4 double randNum = 0; randNum - (Math.random(high-Low) return randum; + low): public static String distanceBetween(Projectile hare, Projectile hound) { 1/get the distance between the projectiles 3 public static void runIteration(int iterationum, int ground) { 1/create the projectiles with their randomized inputs System.out.println("Iteration iterationNum); W/start time System.out.println(" tare: "); 1/while the hare hasn't reached the ground, move it //restart time System.out.println(" Hound: ); //while the hound hasn't reached the ground. move it W/print out the distance between them } public class Projectile { //create attributes for the projectiles (take them from the hw doc) 1/don't forget to generate setters and getters //write the constructor so it takes in the inputs for each projectile and puts the //values in the right attributes public Projectile(/* inputs here...*/) { I } public void move(double time) { //just put the equations from the hw doc in here } //Setters and Getters

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

What is an annuity? Discuss.

Answered: 1 week ago