|
 |
|
|
|
|
|
|
|
|
|
|
Description
For this project you are required to extend a C++ application that has been provided for you. This application follows a simple object-oriented example of a collection of shapes. Three shapes are supported: Circle, Rectangle, and Triangle, and functions are provided to calculate the perimeter and the area of these shapes. A base class has been defined, Shape, which allows the perimeter and area functions to be made polymorphic.
All of the code for the shapes has been provided, along with a simple menu system to drive the application. What is missing, is the collection functionality, i.e., the ability to store several shapes. For this purpose, we will be using an array, as follows:
Example of how the array will be used The first five elements (elements zero through four) have data stored in them, and the remainder of the array has not yet been used. An additional variable, lastUsed, has been used to mark the location or boundary where elements are stored in the array. Thus to store an additional element in the array, it will be stored at the location (lastUsed + 1), and then lastUsed will be incremented to mark the new location.
The following files have been provided for the project which may not be modified:
1. Program.cpp, containing the main() function and several helper functions; 2. Shape.h, defining the Shape base class for the different shapes (there is no .cpp file for the Shape class); 3. Circle.h and Circle.cpp, defining the Circle shape class; 4. Rectangle.h and Rectangle.cpp, defining the Rectangle shape class; and 5. Triangle.h and Triangle.cpp, defining the Triangle shape class.
A skeleton of the class that will define the container, ShapesCollection, has been provided to guide you in this task. You will need to make the following modifications to these files:
1. ShapesCollection.h - you will need to modify the private: section to add attributes to support your functionality, note that the array is already declared, do not modify this line. No other changes are permitted to this header file; and 2. ShapesCollection.cpp - you will need to modify every function provided in this file/class.
The following information will guide you in each of the functions of the ShapeCollection class:
* Constructor - the creation of an array of pointers is required for this program, do not modify this line. You will however need to add lines to initialise any of the attributes you have added to the ShapesCollection.h file. * Destructor - all dynamically allocated memory must be deleted, including the shapes provided to the AddShape function. Note that deletion of the array created in the constructor has already been provided, do not modify this line. * AddShape() - the provided shape must be added to the array as discussed above. You should throw an exception if there is no more room in the array, e.g., throw string("ShapeCollection out of space"); * Count() - return the number of elements currently stored in the array. * TotalAreas() - add up the areas of all the shapes stored in the array and return the total. * TotalPerimeters() - add up the perimeters of all the shapes stored in the array and return the total.
Reminder
You may not start working in this and any project before
your bid is accepted. Any user who violates this policy
may have their account permanently suspended.
|
|
|
Dhaka,
BD
location |
US$20
bid amount |

         
(132
reviews)
feedback |

0 day(s)
delivery time |

|
| |
Please check PM.
regards
Bid Time: 03-10-2008 08:33
|
|
|
|
| Shortlist |
| Decline Bid |
|
|
Montevideo,
UY
location |
US$20
bid amount |

         
(88
reviews)
feedback |

1 day(s)
delivery time |

|
| |
Hi, please check PM.
Bid Time: 03-10-2008 06:48
|
|
|
|
| Shortlist |
| Decline Bid |
|
|
Zaporozhye,
UA
location |
US$20
bid amount |

         
(6
reviews)
feedback |

1 day(s)
delivery time |

|
| |
I'm ready to help you.
Bid Time: 03-10-2008 08:31
|
|
|
|
| Shortlist |
| Decline Bid |
|
|
dhaka,
BD
location |
US$50
bid amount |

         
(7
reviews)
feedback |

1 day(s)
delivery time |

|
| |
hi..............i am interested...
Bid Time: 03-10-2008 06:39
|
|
|
|
| Shortlist |
| Decline Bid |
|
|
nagpur,
IN
location |
US$20
bid amount |

         
(2
reviews)
feedback |

7 day(s)
delivery time |

|
| |
This can be done
Bid Time: 03-10-2008 04:22
|
|
|
|
| Shortlist |
| Decline Bid |
|
|
Cluj Napoca,
RO
location |
US$30
bid amount |

         
(2
reviews)
feedback |

2 day(s)
delivery time |

|
| |
Hello!
I will provide fully commented sources. I have extensive C++ programming experience.
Regards,
Dorra
Bid Time: 03-10-2008 08:37
|
|
|
|
| Shortlist |
| Decline Bid |
|
|
suzhou,
CN
location |
US$20
bid amount |

         
(2
reviews)
feedback |

1 day(s)
delivery time |

|
| |
Please check your pm.
Bid Time: 03-11-2008 01:41
|
|
|
|
| Shortlist |
| Decline Bid |
|
|
Tomsk,
RU
location |
US$20
bid amount |

         
(2
reviews)
feedback |

1 day(s)
delivery time |

|
| |
I write in C++ professionally since 1995. I can write this in 3 hours.
Bid Time: 03-10-2008 03:38
|
|
|
|
| Shortlist |
| Decline Bid |
|
|
Faisalabad,
PK
location |
US$100
bid amount |

         
(2
reviews)
feedback |

1 day(s)
delivery time |

|
| |
please check my messeage
Bid Time: 03-13-2008 01:01
|
|
|
|
| Shortlist |
| Decline Bid |
|
|
Jaipur,
IN
location |
US$20
bid amount |

         
(1
reviews)
feedback |

2 day(s)
delivery time |

|
| |
Hi, i am new to getacoder. But i have good experience in programming.
I will do this work...
Waiting for your response eagerly...
Bid Time: 03-11-2008 12:15
|
|
|
|
| Shortlist |
| Decline Bid |
|
|
Pune,
IN
location |
US$100
bid amount |

(No Feedback
Yet)
feedback |

7 day(s)
delivery time |

|
| |
Can be done....
Bid Time: 03-10-2008 06:31
|
|
|
|
| Shortlist |
| Decline Bid |
|
|
Bangalore,
IN
location |
US$100
bid amount |

(No Feedback
Yet)
feedback |

2 day(s)
delivery time |

|
| |
Please check private message.
Bid Time: 03-10-2008 10:44
|
|
|
|
| Shortlist |
| Decline Bid |
|
|
Bienkowice,
PL
location |
US$20
bid amount |

(No Feedback
Yet)
feedback |

1 day(s)
delivery time |

|
| |
Nice project would like to finish it.
Bid Time: 03-10-2008 13:58
|
|
|
|
| Shortlist |
| Decline Bid |
|
|
na,
IN
location |
US$20
bid amount |

(No Feedback
Yet)
feedback |

2 day(s)
delivery time |

|
| |
hi
i can positively deliver it before 2 days
thanx
Bid Time: 03-10-2008 18:51
|
|
|
|
| Shortlist |
| Decline Bid |
|
|
Dhaka,
BD
location |
US$20
bid amount |

(No Feedback
Yet)
feedback |

1 day(s)
delivery time |

|
| |
Hi, we can do it. Thanks.
Bid Time: 03-11-2008 01:33
|
|
|
|
| Shortlist |
| Decline Bid |
|
|
Lviv,
UA
location |
US$25
bid amount |

(No Feedback
Yet)
feedback |

1 day(s)
delivery time |

|
| |
Hi, I've a good experience in such projects.
Bid Time: 03-11-2008 03:55
|
|
|
|
| Shortlist |
| Decline Bid |
|
|
delhi,
IN
location |
US$40
bid amount |

(No Feedback
Yet)
feedback |

1 day(s)
| | |