/* AUTHOR: [phear]crippler FILE: circumference.cpp PURPOSE: computes circumference of a circle when diameter is known. */ #include using namespace std; double cir(double d); int main() { cout << "This program can calculate the circumference of a circle\nwhen the diameter is known.\n" << endl; double d; char again; cout.precision(4); do { cout << "Enter the diameter: "; cin >> d; cout << "The circumference is: " << cir(d) << endl; cout << "Do another? (Y/N): "; cin >> again; cout << endl; } while(again == 'y' || again == 'Y'); return 0; } double cir(double d = 0.0) { return 3.14159 * d; }