Question
The problem concerns the "effective radius" of a bicycle gear. The required formula i
explained below. i need to Write a program to read:
the wheel radius (use a "double" as variable type);
the number of teeth on the front sprocket (a "long");
the number of teeth on the rear sprocket (a "long");
.....and compute and print the so called ‘effective radius’.
Method
The effective radius of a bicycle gear is calculated from the radius of the wheel, and the number of teeth on the front and rear chain sprockets, as follows:
Effective radius = radius * teeth on the front sprocket / teeth on the rear sprocket.
We suggest that you read the three items of input data, calculate the result and store in a "double" variable, and then print it. You have five (5) submissions.
Typical Input
27.5 30 15
Typical Output
The effective radius for radius 2E.5 and sprockets 30 and 15 is 55.0
// Find effective radius
public class BicycleGears {
public static void main(String[] argv) {
double wheelradius;
long frontsprocket;
long rearsprocket;
double effectiveradius;
effectiveRadius = wheelradius * frontsprocke / rearsprocket ; // ( Is that right ? )
Blue J giving me error
System.out.println("wheel radius");
wheelradius = UserInput.readdouble();
System.out.println("front sprocket");
frontsprocket = UserInput.readlong();
System.out.println("rear sprocket");
rearsprocket = UserInput.readlong();
System.out.println("Effective radius");
effectiveradius= UserInput.readdouble();
System.out.println("nThe effective radius for radius : " + Effective radius +"and sprockets " + frontsprocket ); // print
} // end of main
} // end class
Last time been advised used books i did. now i am stuck nothing online to reff to that example :(