Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CAN SOMEBODY PLEASE HELP WITH THIS PROBLEM ..i WILL RATE RIGHT AWAY THANK YOU C++ assingment Write a C program that will compute the position

CAN SOMEBODY PLEASE HELP WITH THIS PROBLEM ..i WILL RATE RIGHT AWAY THANK YOU C++ assingment

Write a C program that will compute the position of the car and the train, and the distance between them at any given time. Assume that time can be any value from 0 to 10 seconds. The program will prompt the user to enter the speed of the car in miles per hour, the acceleration of the car in feet per second per second, the distance of the car from the crossing, the speed of the train in miles per hour, the distance of the train from the crossing, and the time in seconds

As you are driving down the highway you notice that you are approaching a railroad crossing. You also notice to your right that a train is approaching the same crossing. You are driving west to east, your current speed is 35 miles per hour, you are accelerating at 5 feet per second per second, and you are 200 feet west of the crossing. The train is traveling south to north, the train is moving at a constant speed of 55 miles per hour, and it is 400 feet south of the crossing.

Compute the position of the car and the train, and the distance between them at any given time. Assume that time can be any value from 0 to 10 seconds. The program will prompt the user to enter the speed of the car in miles per hour, the acceleration of the car in feet per second per second, the distance of the car from the crossing, the speed of the train in miles per hour, the distance of the train from the crossing, and the time in seconds. The position of an object that moves along a straight line at a constant acceleration is given by: s=s0+v0t+1/2at^2 Where s0 and V0 are the position and velocity at time = 0, and a is the acceleration.

Applying the above equation to the car and train gives the following position equations: car position = -Scar + Vcar*t +1/2*AccelerationCar*t^2 train position = - Strain + Vtrain*t Where Scar is the initial position of the car and Strain is the initial position of the train.

The distance between the car and train is computed by: distance= SQRT(car^2+train^2) Develop separate equations to compute the velocity of the car and the velocity of the train in feet per second. These computations will be used in the position equations given above.

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

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions

Question

Explain why physical exercise promotes lymphatic circulation.

Answered: 1 week ago