Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Dont know what goes in my main file I have the cpp file of Circle class and header File of Circle class. This program is

image text in transcribed

Dont know what goes in my main file I have the cpp file of Circle class and header File of Circle class. This program is in c++

// header file of cirlce class

#ifndef CIRCLE_H #define CIRLCE_H

class Circle { public: Circle(); Circle(double); double getArea() const; double getRadius() const; void setRadius(double); static int getNumberOfObjects(); bool operator (const Circle& other); bool operator >=(const Circle& other);

private: double radius; static int numberOfObjects; }; #endif

// cpp file of circle class

include "Circle.h"

Circle::Circle(){ radius = 0; numberOfObjects++; } int Circle::numberOfObjects = 0; Circle::Circle(double r){ radius = r; numberOfObjects++; } double Circle::getArea() const{ return 3.14*radius*radius; } double Circle::getRadius() const{ return radius; } void Circle::setRadius(double r){ radius = r; } int Circle::getNumberOfObjects(){ return numberOfObjects; } // overloaded operator bool Circle::operator >(const Circle& other) { if(radius > other.radius) { return true; }else return false; } // overloaded >= operator bool Circle::operator >=(const Circle& other) { if(radius >= other.radius) { return true; }else return false; }

// My main file

#include #include "Rational.h" #include "StackOfIntegers.h" #include "Circle.h" #include using namespace std;

void Prog14_1() { double sum = 0; //Use for loop block to create objects and invoke functions for 100 times. for(int i = 1; i

}

void Prog14_2() { // Create and initialize two rational numbers r1 and r2. Rational r1(4, 2); Rational r2(2, 3);

// Test toString, add, substract, multiply, and divide cout

// Test intValue and double cout

// Test compareTo and equal cout

}

void Prog14_3() {

}

void Prog14_4() { StackOfIntegers s; s.push(1); s.push(2);

s[0] = 999;

cout

}

void Prog14_7() {

}

int main() { while (true) { system("cls"); cout > exercise; cout 14.3 (The Circle class) Implement the relational operators st) in the Circle class in Listing 10.9, CircleWithConstantMemberFunctions.h, to order the Circle objects according to their radii

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago