Question

CSC1101 TakeHome Lab02 (1),docx - Compatibility Mode Saved to this PC S Review View. Help Search 3. [11] You have been hired


Welcome to Projectile 0bjects! The object is launched at an initial velocity of: 10 m/s The angle is: 300 Time that the objec
this is how output should look
CSC1101 TakeHome Lab02 (1),docx - Compatibility Mode Saved to this PC S Review View. Help Search 3. [11] You have been hired by Projectile Objects to create a calculator for various equations from kinematics. Suppose someone shoots an object and it does projectile motion with an angle of 30, 45 and 60 degrees to the horizontal. Choose it's initial velocity (ex. 10 m/s) find the maximum height it can reach, horizontal displacement and total time required for this motion. Here are the four equations you will be using: V=Vo + at 2, Your program should include the following steps: a. Calculate real valued vertical and horizontal velocity from initial velocity (hint: xvelocity-initialVelocity*cos(angle); yVelocity = initialVelocity*sin(angle), make sure you convert angle from degree to radians like so angle angle pi/180); b. In vertical, do the following: i. Calculate the real value for time (hint: V = Vo + a*t → 0 = yVelocity -gravity time - time- yVelocity/gravity, but since this is the time for half of the vertical motion, the real total time is time 2"time) ii. Calculate the real value for maximum height (hint: maxHeight 5*gravity"(5 time), here we have to halve time because we are only considering the vertical displacement, not total distance traveled) c. In horizontal, do the following: i. Calculate the horizontal displacement (hint: X-Xo + Vo*t → maxLength -0+xVelocity time Use constant value for GRAVITY-9.8 m/s/s, PI 3.1415 and for degree symbol char DEG char(167) (if you are using xcode, you can copy a paste your degree symbol into place of char( 167)). Output your results like so:
Welcome to Projectile 0bjects! The object is launched at an initial velocity of: 10 m/s The angle is: 300 Time that the object is in air: 1.02038 t Maximum height reached: 1.27544 m Horizontal displacement: 8.83684 m Welcome to Projectile Objects! The object is launched at an initial velocity of: 10 m/s The angle is: 45° Time that the object is in air: 1.44304 t Maximum height reached: 2.5509 Horizontal displacement: 10.2041 m Welcome to Projectile Objects! The object is launched at an initial velocity of: 10 m/s The angle is: 60 Time that the object is in air: 1.76737 t Maximum height reached: 3.82639 m Horizontal displacement: 8.83731 m your prograni code here If possible, format your oode 1ike this Font "Courier New" Font aize "9" Bold
0 0
Add a comment Improve this question Transcribed image text
Answer #1

import java.util.Scanner;
import java.lang.Math;

public class Projectile {
   public static void main(String[] args) {
       int initial_velocity;
       int angle;
       double xvelocity;
       double yvelocity;
       double time;
       double displacement;
       double height;
       double angle_radian;
       Scanner sc = new Scanner(System.in);
       while(true) {
           System.out.println("Welcome to Projectile Objects!");
           System.out.println("===========================\n");
           System.out.println("The object is launched at an initial velocity of:");
           initial_velocity = sc.nextInt();
           System.out.println("The angle is:");
           angle = sc.nextInt();
          
           angle_radian = angle*(3.1415/180);
           xvelocity = initial_velocity*java.lang.Math.cos(angle_radian);
           yvelocity = initial_velocity*java.lang.Math.sin(angle_radian);
          
           time = yvelocity/9.8;
           time = time*2;
          
           height = 0.5*9.18*java.lang.Math.pow((0.5*time), 2);
          
           displacement = xvelocity*time;
          
           System.out.println("Time that the object is in air: "+time+" t");
           System.out.println("Maximum height reached: "+height+" m");
           System.out.println("Horizontal Displacement: "+displacement+" m");
       }
   }
}

Add a comment
Know the answer?
Add Answer to:
this is how output should look CSC1101 TakeHome Lab02 (1),docx - Compatibility Mode Saved to this PC S Review View. Help Search 3. [11] You have been hired by Projectile Objects to create a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ should be used C++ should be used CSC1101 TakeHome Lab02 (1),docx - Compatibility Mode Saved to this PC s Review View Help ρ Search 3. [11] You have been hired by Projectile Objects to cre...

    C++ should be used C++ should be used CSC1101 TakeHome Lab02 (1),docx - Compatibility Mode Saved to this PC s Review View Help ρ Search 3. [11] You have been hired by Projectile Objects to create a calculator for various equations from kinematics. Suppose someone shoots an object and it does projectile motion with an angle of 30, 45 and 60 degrees to the horizontal. Choose it's initial velocity (ex. 10 m/s) find the maximum height it can reach, horizontal...

  • THE VERTICAL DISPLACEMENT IS NOT ZERO BECAUSE THE PROJECTILE LANDS ON HEIGHT H Problem 1: Consider...

    THE VERTICAL DISPLACEMENT IS NOT ZERO BECAUSE THE PROJECTILE LANDS ON HEIGHT H Problem 1: Consider a projectile launched with an initial velocity of 120 f/s. Let us assume that the projectile lands on a a) Determine the range R as a function of time. b) Determine the initial launch angle, 8, such that the projectile achieves the maximum possible horizontal range Hint: think about how to compute maxima and minima from calculus. Once you have computed the launch angle...

  • ENES 100 Due 11/14/2018 Homework #6 Submit all your work in a thumb drive or via...

    ENES 100 Due 11/14/2018 Homework #6 Submit all your work in a thumb drive or via email using the appropriate filenames 1. When an object is launched from the ground with an initial velocity of vo at an angle of 0o, the horizontal and vertical displacements of the object travel before it hits ground can be written as functions of time t: x(t) - vo t cos(e) Uo Figure 1: Projectile of an object. A baseball has been tossed with...

  • EXPLORE A projectile is launched with a launch angle of 30° with respect to the horizontal...

    EXPLORE A projectile is launched with a launch angle of 30° with respect to the horizontal direction and with an initial speed of 10 m/s. s0 (A) How do the vertical and horizontal components of the projectile's velocity vary with time? 40 35 (B) How long does it remain in flight? 25 (C) For a given launch speed, what launch angle produces the longest time of flight? 15 10 toy CONCEPTUALIZE Consider the projectile to be a point mass that...

  • EXPLORE A projectile is launched with a launch angle of 30° with respect to the horizontal...

    EXPLORE A projectile is launched with a launch angle of 30° with respect to the horizontal direction and with an initial speed of 40 m/s. (A) How do the vertical and horizontal components of the projectile's velocity vary with time? (B) How long does it remain in flight? (C) For a given launch speed, what launch angle produces the longest time of flight? CONCEPTUALIZE Consider the projectile to be a point mass that starts with an initial velocity, upward and...

  • 213 2.4 #3 Projectile Motion Problem (24 Points) A mortar round is fired at an angle...

    213 2.4 #3 Projectile Motion Problem (24 Points) A mortar round is fired at an angle of 60.0 deelative to the horizontal axis with an initial speed of 300 m/s at a height of 950 meters above a level surface? Neglect the effects of air resistance, etc. and take the gravitational acceleration to be 9.8 m/s vertically down- ward a. What are the horizontal and the vertical components of the mortar round's velocity immediately after being launched? 300 cos(60) 160...

  • 0 - Incomplete Projectile Motion: Look again at chapter 3, sections 7 and 8. Problem 1:...

    0 - Incomplete Projectile Motion: Look again at chapter 3, sections 7 and 8. Problem 1: Problem 3.29 of Giancoli lan bah Problem 2: I throw a ball, mass m-5.0kg, at an initial speed of 3.0m/s, at an initial height of 1.7m, but at an angle of 37' with respect to the horizontal. It lands on the ground, at a final height of zero. (a) What is the initial velocity? (This is a VECTOR. Define ti as the horizontal, and...

  • Q2. A) Projectile motion (General launch angle): Select any one of the options as answer A...

    Q2. A) Projectile motion (General launch angle): Select any one of the options as answer A football kicker is attempting a field goal from 44 m out. The ball is kicked and just clears the lower bar with a time of flight of 2.9 s. If the angle of the kick was 45°, what was the initial speed(Vo) of the ball, assuming no air resistance? a) 21.5 m/s b) 19.7 m/s c) 2.2 m/s d) 39 m/s (Hint: x-Xo =...

  • 7. Do the projectile motion General Motion with Unit Vectors and Components An object undergoes the...

    7. Do the projectile motion General Motion with Unit Vectors and Components An object undergoes the following consecutive displacements: s (2i +3j +5k)m,s2 (6i- 9j + 2k)m, and s3 (10i 8j -k)m. a) Find the resultant displacement in terms of unit vectors and components. b) State the magnitude of the resultant displacement. 2. Suppose a hiker travels 5 km southwest from their camp. Then, the hiker travels 2 km 75° north of east. a) Find the displacement of the hiker...

  • (Please show the steps to the solutions, and draw a diagram if you can) 1) In...

    (Please show the steps to the solutions, and draw a diagram if you can) 1) In a linear motion, velocity changes with time as Find distance and displacement for the time interval from 1.5 s to 5 s. 2) A projectile is launched from the edge of 50 m high vertical cliff at an angle of above horizontal. The projectile hits the ground at a distance of 150 m from the bottom of the cliff. FInd the initial and final...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT