C++ Program Problem Need HELP!!!

This is a discussion on C++ Program Problem Need HELP!!! within the C++ Programming forums, part of the General Programming Boards category; I am having trouble writing a C++ program to calculate and display the circumference of the ball and the number ...

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

    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.

    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;
    }
    Last edited by DMJJR1988; 09-15-2010 at 08:27 PM. Reason: Wrong Instructions

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,761
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 03:38 PM
  4. Replies: 20
    Last Post: 06-13-2005, 12:53 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21