A meteorite is heading towards earth Create a program that p

A meteorite is heading towards earth. Create a program that prompts the user to enter the speed in m/s and the mass of the meteorite in kilograms. If the momentum, i.e., speed times mass (speed\'mass) of the meteorite is less than 10E9 kg*m/s, send a message to the command window telling the user to relax. If the momentum is between 10E9 and 10E10 kg*m/s, send a message to the user to find a shelter. If the momentum is more than 10E10 kg*m/s, send a message to the user all hope is lost.

Solution

speed = input(\'Enter the speed(m/s): \');
mass = input(\'Enter the mass(kg): \');

momentum = speed * mass;

if momentum < 10E9
   disp(\'Relax\');
elseif momentum < 10E10
   disp(\'Find a shelter\');
else
   disp(\'All hope is lost\');  
end

 A meteorite is heading towards earth. Create a program that prompts the user to enter the speed in m/s and the mass of the meteorite in kilograms. If the momen

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site