Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Close Lab S: Create and use a class Problem Description: Design a class named Triangle that extends Geometricobiect. The class contains: default values to denote

image text in transcribed
Close Lab S: Create and use a class Problem Description: Design a class named Triangle that extends Geometricobiect. The class contains: default values to denote three sides of the triangle A constructor that creates a triangle with the specified Three double data fields named sidel. side. and side3 with . A no-arg constructor that creates a default triangle sidel, side2, and side3 . The accessor methods for all three data fields .A method named getAreal0 that returns the area of this .A sethod named getPerieto that returns the perimeter of .A method named tostring) that returns a string description triangle this triangle. for the triangle For the formula to compute the area of a triangle, see Exercise 5.19. The toStringmethod is implemented as Eollows: Draw the UML diagran that involves the classes Triangle and Gecmetricobiet Implement the class. Write a test program that creates a Triangle object with sides 1. 1.5, 1. color yellow and filled true, and displays the area, perimeter, color, and hether filled or not Design: Draw the UML class diagram here Coding: publie elass Exerese11 01 public static wold main(Stringtl args) Triangle triangle-new Trianglei. 2.5, ) trsangle.setColor "yelLow) triangle.setFilled(tzue) a System.out-printinttriangle) ystem.out-printin(The area lariangle.getArea0 Systen.out-printin The perimeter is triangle.getPerimeter O) ystem.out-printinttriangle)a elass Geonete Lecbject Copy it from the book class Triangle extends Geometricobject Implement it Submission Follow our class coding standard to complete this lab, check out for credit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

More Books

Students also viewed these Databases questions

Question

Functions do not require input arguments. True False

Answered: 1 week ago