hree double data fields named base, height, and hypotenuse that specifies ngth of the three sides of the right-angled triangle. The default values for e: o Base: 3.0 o Height: 4.0 o Hypotenuse: 5.0 no-arg constructor that creates a default triangle. constructor that creates a triangle with a specified base, height, and hypot hree get and set methods for each of the private data fields. method named getArea() that returns the area of the triangle: o Area = ¹/2 (base * height) method named getPerimeter() that returns the perimeter of the triangle: o Perimeter = base + height + hypotenuse ake sure to follow this sequence of steps: raw the UML of the Triangle class. The data fields should be private, and onstructors and all other methods should be public.
hree double data fields named base, height, and hypotenuse that specifies ngth of the three sides of the right-angled triangle. The default values for e: o Base: 3.0 o Height: 4.0 o Hypotenuse: 5.0 no-arg constructor that creates a default triangle. constructor that creates a triangle with a specified base, height, and hypot hree get and set methods for each of the private data fields. method named getArea() that returns the area of the triangle: o Area = ¹/2 (base * height) method named getPerimeter() that returns the perimeter of the triangle: o Perimeter = base + height + hypotenuse ake sure to follow this sequence of steps: raw the UML of the Triangle class. The data fields should be private, and onstructors and all other methods should be public.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Need help writing the

Transcribed Image Text:Define a class of Triangles.
Design a class named Triangle. This class represents a right-angled triangle. The class
contains:
Three double data fields named base, height, and hypotenuse that specifies the
length of the three sides of the right-angled triangle. The default values for each
are:
o Base: 3.0
o Height: 4.0
o Hypotenuse: 5.0
➤ A no-arg constructor that creates a default triangle.
➤ A constructor that creates a triangle with a specified base, height, and hypotenuse.
➤ Three get and set methods for each of the private data fields.
➤ A method named getArea() that returns the area of the triangle:
o Area = ½ (base * height)
A method named getPerimeter() that returns the perimeter of the triangle:
o Perimeter = base + height + hypotenuse
Please make sure to follow this sequence of steps:
1. Draw the UML of the Triangle class. The data fields should be private, and
constructors and all other methods should be public.
2. Implement the Triangle class (named “Triangle") in Triangle.java.
3. Implement the TestTriangle class (named “TestTriangle") with the main method
in Test Triangle.java. It should do the following tasks:
Create a default triangle object.
Change the triangle to have a base of 5.0, a height of 12.0, and a hypotenuse
of 13.0
Print out the area of the triangle.
Print out the perimeter of the triangle.

Transcribed Image Text:The base before is
The height before is
The hypotenuse before is
The base after is
The height after is
The hypotenuse after is
The area is
The perimeter is
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 2 images

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY