Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how do I code this in C++ ? CS 161 Gayathri lyer Assignment #3 Input/Output Assignment: Two cars A and B leave an intersection at

image text in transcribed

how do I code this in C++ ?

CS 161 Gayathri lyer Assignment #3 Input/Output Assignment: Two cars A and B leave an intersection at the same time. Car A travels west 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. o Ex: For two hours and 30 minutes, 2 30 would be entered The program then outputs: 1. The shortest) distance between the cars. Hint: You will need to use the Pythagorean theorem to calculate the distance. Deliverables: Please upload your program source code (.cpp file) as usual. Name your file a03.cpp. Be sure to comment your code as required, and to acknowledge any sources of help you may have received. Your header comments should include the identification of the assignment and your name(s). It should also include a comment indicating any sources of help you may have received. If there were none, the line should read

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

More Books

Students also viewed these Databases questions

Question

How competitive is the external environment of your organization?

Answered: 1 week ago

Question

What other organizations compete on this issue?

Answered: 1 week ago

Question

What significant opposition exists?

Answered: 1 week ago