I am having trouble writing a C++ program to calculate and display the circumference of the ball and the number of revolutions of the ball on the alley along its entire length.
My main concern is figuring out how to enter the code for calulating & displaying the revolution part. I have figured out everything else but that part.
Here is what i have so far. If someone can help me i would greatly appreciate it.
Code:
// To calculate and display the circumference and revolutions of a bowling ball.
#include <iostream>
using namespace std;
// define identifier PI with a constant
#define PI 3.14
// define identifier TWO with a constant
#define TWO 2.0
int main()
{
float circumference, radius;
cout<<"\nEnter the diameter if the ball in cm (15, 16, 17, 18, 19 or 20) 15: ";
cin>>radius;
// circumference = 2*PI*radius
circumference = PI * radius;
// circle circumference
cout<<"\nThe Circumference = "<<circumference<<" cm"<<endl;
return 0;
}