Answered step by step
Verified Expert Solution
Question
1 Approved Answer
- You will implement 2 classes named Triangle and Circle. All names will be exactly as specified here, case included. You will submit a .cpp
- You will implement 2 classes named Triangle and Circle. All names will be exactly as specified here, case included. You will submit a .cpp file and a .h file for each of these classes. The submission is 4 files total. You will write your own test driver to exercise and test these classes but you will not submit the test driver to me. I will have my own test driver and will plug your classes into my project to test them. - General note - Make sure all the integers receive positive values. If a negative value is given, handle it gracefully. Suggestions include convert it to a positive value of the same magnitude (change -1 to 1), or provide a default value and issue an error message. See note about the Triangle::GetArea() function - make sure this doesn't crash and do error checking as described. - The Triangle class will contain the following private data: - The triangle classes will contain 2 constructors and one destructor. The destructor in this case will simply display a parting message (Ex: "Good bye cruel world! You won't have the Triangle to kick around anymore!") The constructors will be: - A default constructor with no arguments. It will provide default values to the member variables - Another constructor will take 3 integers as arguments and will set the member variables to those values
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started