Alpha Geek

(8)

$10/per page/Negotiable

About Alpha Geek

Levels Tought:
University

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Environmental science,Essay writing,Programming,Social Science,Statistics Hide all
Teaching Since: Apr 2017
Last Sign in: 438 Weeks Ago, 1 Day Ago
Questions Answered: 9562
Tutorials Posted: 9559

Education

  • bachelor in business administration
    Polytechnic State University Sanluis
    Jan-2006 - Nov-2010

  • CPA
    Polytechnic State University
    Jan-2012 - Nov-2016

Experience

  • Professor
    Harvard Square Academy (HS2)
    Mar-2012 - Present

Category > Programming Posted 01 Jun 2017 My Price 8.00

Draw the UML diagrams for the classes Triangle and GeometricObject and implement the classes

11.1          (The Triangle class) Design a class named Triangle that extends

GeometricObject. The class contains:

■     Three double data fields named side1, side2, and side3 with default values 1.0 to denote three sides of the triangle.

■     A no-arg constructor that creates a default triangle.

■     A constructor that creates a triangle with the specified side1, side2, and

side3.

■     The accessor methods for all three data fields.

■     A method named getArea() that returns the area of this triangle.

■     A method named getPerimeter() that returns the perimeter of this triangle.

■     A method named toString() that returns a string description for the triangle.

For the formula to compute the area of a triangle, see Programming Exercise 2.19. The toString() method is implemented as follows:

return "Triangle: side1 = " + side1 + " side2 = " + side2 +

" side3 = " + side3;

Draw the UML diagrams for the classes Triangle and GeometricObject and implement the classes. Write a test program that prompts the user to enter three sides of the triangle, a color, and a Boolean value to indicate whether the triangle is filled. The program should create a Triangle object with these sides and set the color and filled properties using the input. The program should display the area, perimeter, color, and true or false to indicate whether it is filled or not.

 

Answers

(8)
Status NEW Posted 01 Jun 2017 09:06 AM My Price 8.00

-----------

Attachments

file 1496308783-Answer.docx preview (202 words )
S-----------olu-----------tio-----------n -----------Ple-----------ase----------- fi-----------nd -----------the----------- so-----------lut-----------ion----------- an-----------d a-----------tta-----------che-----------d U-----------ML -----------Dia-----------gra-----------m :----------- im-----------por-----------t j-----------ava-----------.ut-----------il.-----------Sca-----------nne-----------r; -----------cla-----------ss -----------Geo-----------met-----------ric-----------Obj-----------ect----------- { -----------pub-----------lic----------- Ge-----------ome-----------tri-----------cOb-----------jec-----------t()----------- { -----------} p-----------ubl-----------ic -----------dou-----------ble----------- ge-----------tAr-----------ea(-----------) {----------- re-----------tur-----------n 0-----------.0;----------- } -----------pub-----------lic----------- do-----------ubl-----------e g-----------etP-----------eri-----------met-----------er(-----------) {----------- re-----------tur-----------n 0-----------.0;----------- } -----------} c-----------las-----------s T-----------ria-----------ngl-----------e e-----------xte-----------nds----------- Ge-----------ome-----------tri-----------cOb-----------jec-----------t {----------- pr-----------iva-----------te -----------Str-----------ing----------- co-----------lor-----------; p-----------riv-----------ate----------- bo-----------ole-----------an -----------fil-----------led-----------; p-----------riv-----------ate----------- do-----------ubl-----------e s-----------ide-----------1 =----------- 1.-----------0; -----------pri-----------vat-----------e d-----------oub-----------le -----------sid-----------e2 -----------= 1-----------.0;----------- pr-----------iva-----------te -----------dou-----------ble----------- si-----------de3----------- = -----------1.0-----------; p-----------ubl-----------ic -----------Tri-----------ang-----------le(-----------) {----------- } -----------pub-----------lic-----------
1496308793-1388578_1_UML-Diagram.jpg
Not Rated(0)