Question
Two cars A and B leave an intersection at the same time. Car A travels east at an average speed of x miles per hour
Two cars A and B leave an intersection at the same time. Car A travels east at an average speed of x miles per hour and car B travels south at an average speed of y miles per hour. Write a program that prompts the user to enter:
1.The average speed of Car A and Car B as two separate input statements.
2.The elapsed time (in hours and minutes, separated by a space) after the cars leave the intersection.
(Ex: For two hours and 30 minutes, 2 30 would be entered)
The program then outputs:
1.The (diagonal) distance between the cars when they have traveled for that amount of time. The distance should be expressed in miles, with three decimal places of precision.
Please upload your program source code (.cpp file) as usual. Be sure to comment your code as required, use meaningful variable names, and acknowledge any sources of help you may have received.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started