Answer to Question #250271 in C++ for John

Question #250271

The 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-12T07:40:07-0400

#define PI 3.142

#include <math.h>


int calcrev(double D, double X) {

    double C = PI * D;


    X = X * 1000.0 / 60.0;


    return (int)round(X / C);

}


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