コード例 #1
0
void PrintGeometricObject::PrintObject(Circle& c)
{
	// Todo
	cout << "Circle\n";
	cout << "  radius:        " << c.radius_ << " " << c.measurementUnit_ << "\n";
	cout << "  circumference: " << c.Circumference() << " " << c.measurementUnit_ << "\n";
	cout << "  area:          " << c.Area() << " " << c.measurementUnit_ << "^2\n\n";
}
コード例 #2
0
ファイル: main.cpp プロジェクト: adde/circle
void calcCircum()
{
	int radius = 0;

	cout << "Enter radius of the circle: " << endl;
	cin >> radius;

	Circle c = Circle((int)radius);

	cout << "The circle with a radius of " << radius << " has a circumference of " << c.Circumference() << endl << endl;
}