Skip to main content

Assume that you’ve been asked to create a class to represent a triangle.

Assume that you’ve been asked to create a class to represent a triangle.

-The triangle is defined by the length of its 3 sides. Each length is an integer.

-The triangle must have a default constructor that sets the length of each side to 3, 4 and 5 respectively. The triangle must have an additional 3 argument constructor that allows the length of each side to be specified.

-The triangle must have 3 getter (accessor) methods that allow a programmer to retrieve the the length of each side.

-The triangle must have 3 setter (mutator) methods that allow a programmer to change the length of each side.

-The triangle must have 4 additional methods isEquilateral, isScalene, isIsosceles and isRight. Each method has no parameters and returns a boolean value.

This is what you need to do:

-Implement the triangle class.

-Use the supplied test program to test your class.

-Submit one zip file to moodle. The zip file will contain your program and the Code::Blocks Project information.

-Submit a file containing output that documents that all of your methods work.

 



Comments

Popular posts from this blog

Apply duty-based ethical theories to contemporary moral issues

Instructions In this research-based assessment, you will be applying a Kantian perspective to a contemporary moral issue. Current contemporary moral issues range from genetic engineering to issues related to the use of torture in wartime. For this assessment you will need to research contemporary moral issues and select one that will be the focus of your paper as you apply the Kantian perspective. Once you select your moral issue, you will need to address the following in a properly formatted research paper. · Explain what duty is according to Kant and how this view differs from other senses of duty. · Describe the relationship between a good will and duty for Kant. · Differentiate the two formulations of the Categorical Imperative. · How do these formulations apply to your selected contemporary moral issue? · Using the foundation of Kant’s moral theory explain how there is a moral duty for your selected contemporary moral issues. · Express your view as a maxim. · How feasible is it to...