Ascending Circles

Im supposed to create an to array of eight Circle objects initialized with the following radii: 2.5, 4.0, 1.0, 3.0, 6.0, 5.5, 3.5, 2.0. Then use a bubble sort to arrange the objects in ascending order of radius size before displaying the area of each object.

The error I get is "Cannot open include file: 'Circle.h': No such file or directory"

Any idea? Do I have to create a separate file for it?
Thanks


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include <iomanip>
#include "Circle.h"
using namespace std;

class Circle
{
public:
Circle()
};

//Function prototype
void bubbleSort( Circle array[], int);

const int NUM_CIRCLES = 8;

int main()
{ 
Circle circle[NUM_CIRCLES] = {2.5, 4.0, 1.0, 3.0, 6.0, 5.5, 3.5, 2.0 } ;

for (int index = 0; index < NUM_CIRCLES; index++)
{
double r;
cout <<"The radius for circle" << (index+1) << ": ";
circle[index].setRadius(r);
}


cout << fixed << showpoint << setprecision(2);
cout <<"\nHere are the area of the " << NUM_CIRCLES
 << " cricles.\n";
for (int index = 0; index < NUM_CIRCLES; index++)
{
cout << "circle " << (index+1) << setw(8)
 << circle[index].findArea() << endl;
}

return 0;
}
Unless you explicitly created a header file for your class declaration, why are you including "circle.h"?
Topic archived. No new replies allowed.