MyGitHub
Description: Create a program that asks for the radius of a circle and prints the area of that circle, using cin and cout. The whole program should be divided into two source files (.cpp). Hand in the source files and the head files which you create.
main.cpp
#include<iostream>
using namespace std;
#include"circle.h"
int main()
{
int s,r;
circle circle;
cout << "Please enter the radiu:";
while (cin>>r)
{
cout <<"The area is "<< circle.calculatecircle(r) << endl;
cout << "Please enter the radiu:";
}
return 0;
}
Circle.cpp
#include "circle.h"
#include<math.h>
#define pai 3.1415926
double circle::calculatecircle(double r)
{
double s;
s = r*r*pai;
return s;
}