Thread: C++ Program Problem Need HELP!!!

  1. #1
    Registered User
    Join Date
    Sep 2010

    C++ Program Problem Need HELP!!!

    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.

    // 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: ";
       // circumference = 2*PI*radius
       circumference = PI * radius;
       // circle circumference
       cout<<"\nThe Circumference = "<<circumference<<" cm"<<endl;
       return 0;
    Last edited by DMJJR1988; 09-15-2010 at 07:27 PM. Reason: Wrong Instructions

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multi Thread Program Problem
    By ZNez in forum C Programming
    Replies: 1
    Last Post: 01-03-2009, 11:10 AM
  2. Program Termination Problem
    By dacbo in forum C Programming
    Replies: 3
    Last Post: 01-23-2006, 02:34 AM
  3. Inheritance and Dynamic Memory Program Problem
    By goron350 in forum C++ Programming
    Replies: 1
    Last Post: 07-02-2005, 02:38 PM
  4. Replies: 20
    Last Post: 06-12-2005, 11:53 PM