radius compute circumference & area

// Project6.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <cmath>

using namespace std;

const double PI = 3.14;

//======Function Prototypes======
void WelcomeMessage(void);
void GetValue(double&);
double ComputeCircumference(double);
void ComputeArea(double radius, double& area);
void OutputData(double radius, double& circumference, double& area);
bool GoAgain();
//===============================

int main() {

double radius = 0;
double circumference;
double area = 0;
double a;

void WelcomeMessage();

do {
GetValue( radius );

circumference = ComputeCircumference(radius);
ComputeArea(radius, area);

OutputData(radius, circumference, area);

} while (GoAgain());



return 0;
}// Function main()

// =====================================
void WelcomeMessage(void) {
cout << "==========================================" << endl;
cout << "Welcome to Programming Assignment Six " << endl;
cout << endl;
cout << "Finding the radius, circumference, and area of a circle" << endl;
cout << "==========================================" << endl;
cout << endl;
}// End of Function WelcomeMessage()

// ====================================
void GetValue(double& radius2) {

cout << "Please enter your radius of a cirlce ";
cin >> radius2;

}// End of Function GetValue(radius)

// =================================================
double ComputeCircumference(double radius1) {

double c;

c = 2 * PI * radius1;

return c;
}// End of Function ComputeCircumference ()

// ======================================================
void ComputeArea(double radius, double & area) {

area = PI * radius * radius;


}// End of Function ComputeArea()

// ==========================================
bool GoAgain() {

char again;
cout << "Would you like to go again? (Y/N)" << endl;
cin >> again;

if (again == 'Y' || again == 'y') {

return true;
}
return false;
}// End of Function GoAgain()

// =============================================
// ======================================================
void OutputData(double radius, double & circumference, double & area) {

cout << endl;
cout << "The radius entered is ==> " << radius << endl;
cout << "The circumference of the circle is ==> " << circumference << endl;
cout << "The area of the circle is " << area << endl;
cout << endl;


}// End of Function OutputData()

Write a program that asks for a value for the radius of a circle. The program should then compute the circumference and area.

1.) You should have a user loop.
2.) There should be a void banner() function that welcomes the user.
3.) There should be a void function called GetValue()
4.) There should be a value-returning function that calculates the
circumference called ComputeCircumference().
5.) There should be a void function that calculates the area called
ComputeArea().
6.) There should be a value-returning function call GoAgain() whose return
type is bool.
7.) There should be a void function called OutputData() that outputs the
radius, the circumference, and the area o the circle in a beautiful
format.


so far I have coded a little over half the assignment. the only thing I kind of need help on is the Welcome message to output on the output window. The other thing is my calculations of the circle mesurements. I used a calculater to confirm the results on my program and the answers are off by a couple decimal numbers.
Please respond to my previous post before I can help you with the next.
http://www.cplusplus.com/forum/general/201336/#msg959882

If your problem was solved, then mark the thread as solved.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
int main() {

double radius = 0;
double circumference;
double area = 0;
double a;

void WelcomeMessage();

do {
GetValue( radius );

circumference = ComputeCircumference(radius);
ComputeArea(radius, area);

OutputData(radius, circumference, area);

} while (GoAgain());



return 0;
}// Function main() 


It should be :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
int main() {

double radius = 0;
double circumference;
double area = 0;
double a;

WelcomeMessage();

do {
GetValue( radius );

circumference = ComputeCircumference(radius);
ComputeArea(radius, area);

OutputData(radius, circumference, area);

} while (GoAgain());



return 0;
}// Function main() 
The other thing is my calculations of the circle mesurements. I used a calculater to confirm the results on my program and the answers are off by a couple decimal numbers. 


Your calculator will undoubtably use a much more accurate value of PI than the 3.14 that you have used. If you are going to make it a double then give it a value to more than 3 sig. fig. - you could take this constant off your calculator to avoid a function call.
Thank you so much for the help @SakurasouBusters @Boxbird @lastchance i got my program to work properly.
Topic archived. No new replies allowed.