Need help!!!!!! Asap!!!!!

• 09-15-2010
DMJJR1988
Need help!!!!!! Asap!!!!!
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; }```
• 09-15-2010
User Name:
Stop yelling!!!!!!!!!!! Please!!!!!!!!!!!!!!!!!!! Lot's of punctuation is also really annoying, see????????????
• 09-15-2010
VirtualAce
• 09-15-2010
Lesshardtofind
I'm not sure what you mean by number of revolutions. So I'll take a stab in the dark.
If this is based on a concept that you roll this ball in a straight line down an alley, and the point of contact on the ball can be drawn in an EXACT line on its surface, then the number of revolutions would easily be a function of its curcumference. If the problem is that simple I'm not going to give the direct equation becuase it is quite obvious but I'll clue that it would use 3 variables.. the one you are solving for number of revolutions. The curcumference of the ball, and the distance of the alley from ball start point to ball stop point. Good luck.

P.S. Try to be a little more down to earth with the subject next time it helps ;o).
• 09-16-2010
Michael432000
Circumference = PI * diameter.

If the circumference of your ball was 1 metre (100cm) and the alley was 10 metres long, then the ball would revolve 10 / 1 = 10 times.

Cout - Enter length of Alley in metres:
Cin – alleyLength

//Convert circumference of ball to metres
circumference = circumference / 100

rollsNum = alleyLength / circumference

cout – Number of rolls = rollsNum