Question: This is an Intro to Programming class in C++, I get the right ouput until having to sort the array by area: Sorting an array

This is an Intro to Programming class in C++, I get the right ouput until having to sort the array by area:

Sorting an array of Circle objects

Create a Circle class with one data member for the radius. Provide a no-arg. constructor and a constructor that takes a radius (in double) as the parameter. Implement getter methods to get the radius and area of a Circle object. In the driver, create an array of 20 circle objects. Randomly generate the radius between 10.00 to 90.00 units of measurement for the objects before populating them into the array. Sort the objects by areas. Display the radii and areas of the Circle objects in the array, before and after sorting.

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!