Thread: Need help!!!!!! Asap!!!!!

  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    2

    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;
    }

  2. #2
    Password:
    Join Date
    Dec 2009
    Location
    NC
    Posts
    587
    Stop yelling!!!!!!!!!!! Please!!!!!!!!!!!!!!!!!!! Lot's of punctuation is also really annoying, see????????????

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Putting ASAP in your thread title will only cause people to ignore your thread.

  4. #4
    Bored Programmer
    Join Date
    Jul 2009
    Location
    Tomball, TX
    Posts
    428
    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).

  5. #5
    Registered User
    Join Date
    Sep 2010
    Posts
    33
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. An Access Violation Segmentation Fault. Need Help ASAP
    By darknessfalls in forum C Programming
    Replies: 2
    Last Post: 08-22-2010, 05:56 AM
  2. need help ASAP ,
    By Haytham in forum C Programming
    Replies: 3
    Last Post: 05-14-2007, 10:21 AM
  3. Need Help ASAP....
    By Maxwell in forum C++ Programming
    Replies: 16
    Last Post: 09-14-2005, 06:56 PM
  4. Count_nums (need help ASAP!)
    By legacye in forum C Programming
    Replies: 6
    Last Post: 11-22-2003, 06:32 PM
  5. Help Needed Asap With Searching An Array!
    By HelpMe++ in forum C++ Programming
    Replies: 5
    Last Post: 05-23-2003, 04:44 AM