Question: 1: Based on Program 13-1 in the textbook, create a class name Circle with the following declarations by completing missing methods. (Hint: you can use

1: Based on Program 13-1 in the textbook, create a class name Circle with the following declarations by completing missing methods.

(Hint: you can use PI=3.14.)

//Circle class declaration

class Circle

{

private:

double radius;

public:

void setRadius(double);

double getRadius () const;

double getArea () const;

double getPerimeter () const;

};

2. Program: Circle.h and newCircle.cpp

a) Create a class specification file, Circle.h, that contains the Circle class declaration

b) Create a class implementation file, Circle.cpp, that contains the member function definition, with a constructor that can accept arguments

c) Create a program, newCircle.cpp, that generate two instances of the Circle class

d) Based on Program 13-8 in the textbook, create two instances of the Circle class, pizza1 and pizza2, which can have different size (radius).

Hint: Use the example source code in Rectangle Version 4.zip to create a multi-file project.

Step 1: In Dev-C++, go to file -> New -> Project to create an empty project

Setp 2: Go to Project -> Add to project, add new cpp files and header files (e.g. Rectangle.cpp and Pr13-8.cpp).

Step 3: Compile and run

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!