Answer to Question #250572 in C++ for naima

Question #250572

diameter of a cycle wheel is D. Given that, the cycle travels at an average speed of X km/h,

find the number of revolutions made by the wheel per minute, giving your answer to the nearest whole

number (assume PI = 3.142). Write a C++ function to calculate revolutions per minute.


1
Expert's answer
2021-10-13T03:50:31-0400
#include <iostream>
 
using namespace std;
const double pi = 3.142;
 
double RevPerMin(double D, double S);
 
int main()
{
	double D;
	cout << "Enter diameter (in meters): ";
	cin >> D;
	
	cout << "Enter average speed (in km/h): ";
	double S;
	cin >> S;
	cout << "Revolutions per minute is: " << RevPerMin(D, S) << endl;
	return 0;
}
 
double RevPerMin(double D, double S)
{
	S /= 3.6;					// converse to m/s
	return 60 / (D * pi / S);	// D*pi/S - amount of time per revolution in seconds, 60 / - it is number of seconds in a minute
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS