Using the fourstep development method write a function doubl
Solution
#include <iostream>
#include <cmath>
using namespace std;
const double PI = 3.14;
void compute();
void Getvalue(double&);
double computeCircumference(double);
double computeArea(double, double& );
// ===============
int main() {
double c;
double radius = 0;
double area = 0;
double a;
Compute();
Getvalue(radius);
c = computeCircumference(radius);
a = computeArea(radius,area);
cout << c << endl;
cout << a << endl;
return 0;
} // Function Main
void Compute() {
cout << \"Please Enter a value for the radius of a circle.\" << endl;
cout << \"I will tell the circumference and area of it. \" << endl;
} // Function Compute
void Getvalue(double& radius2) {
cout << \"Please enter your radius of a circle: \";
cin >> radius2;
} // Funciton Getvalue
// ======================
// ====================
double computeCircumference( double radius1) {
double c;
c = 2*PI*radius1;
return c;
}// Function computecircumference
// =================================
// ================
void computeArea(double radius2, double& a) {
a = PI*pow(radius2,2);
}
| #include <iostream> #include <cmath> using namespace std; const double PI = 3.14; void compute(); void Getvalue(double&); double computeCircumference(double); double computeArea(double, double& ); // =============== int main() { double c; double radius = 0; double area = 0; double a; Compute();
Getvalue(radius);
c = computeCircumference(radius); a = computeArea(radius,area); cout << c << endl; cout << a << endl; return 0; } // Function Main void Compute() {
cout << \"Please Enter a value for the radius of a circle.\" << endl; cout << \"I will tell the circumference and area of it. \" << endl;
} // Function Compute void Getvalue(double& radius2) {
cout << \"Please enter your radius of a circle: \"; cin >> radius2;
} // Funciton Getvalue // ====================== // ==================== double computeCircumference( double radius1) { double c; c = 2*PI*radius1; return c; }// Function computecircumference // ================================= // ================ void computeArea(double radius2, double& a) {
a = PI*pow(radius2,2);
} |



