Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

j [Speeding Car ] A red and blue car were involved in a head-on collision. The r

ID: 3529656 • Letter: J

Question

j

[Speeding Car ] A red and blue car were involved in a head-on collision. The red car was at a standstill and the blue car was possibly speeding. Eyewitness video recorded immediately following the moment of impact showed the two cars entangled together, traveling at 30 mph. The red car weighs 2,000 pounds, and the speed limit is 65 mph. Write a C++ program that allows the user to enter the weight of the blue car and determines whether the blue car was speeding. Hint: 1 mph = 0.447 m/s, and 1 pound = 0.4536 kg. Conservation of momentum dictates that the total momentum before a collision equals the total momentum after a collision as in the following equation: m1v1 + m2v2 = (m1 + m2)v

Explanation / Answer

#include <iostream>

using namespace std;

int main()
{
float wBlue;
float sBlue;
cout << "Enter the weight of blue car in pounds" << endl;
cin>>wBlue;

float wRed=2000*0.4536;
float sRed=65*0.447;
float totalSpeed=30*0.447;

sBlue=(((wRed+wBlue)*totalSpeed)-(wRed*sRed))/wBlue;

cout<<" Speed of blue car is :"<<sBlue;
return 0;
}