Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Design a class named Triangle that extend GeometricObject

(The Triangle class) Design a class named Triangle that extend 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. The 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 returnd 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 diagram fro the classes Triangle and GeometricObject and implement the classes. Write a 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 Traiangle 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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92027733
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Question 1-what is cost and benefit analysis explain the

Question: 1- What is cost and benefit analysis? Explain the two different types of costs and two different types of benefits. 2- Discuss root-cause analysis as a BPA activity. What are the strengths and limitations of th ...

Assume you have been selected to build a system for

Assume you have been selected to build a system for Oil&Gas company. Do you prefer to build a win-based system or a web-based system? Why?

Research current literature to identify a recent project

Research current literature to identify a recent project that has combined the processing capacity of numerous small computers to address a problem. Identify the operating system used to coordinate the processors for thi ...

Given an undirected graph with both positive and negative

Given an undirected graph with both positive and negative edge weights, design an algorithm to find a maximum spanning forest with the largest total edge weights.

A different ethanol processing facility costs 800000 to

A different ethanol processing facility costs $800,000 to construct but will instead last forever. Every year (starting the year after construction), it produces 10,000 barrels of ethanol and can charge a price of $4 per ...

Can someone help me with thiswrite your own class called

can someone help me with this Write your own class called WeatherStats to manage the ordered collection of high temperatures. Have two constructors, one for a default maximum size collection of 10, and the second for a u ...

Question subject digital securitybriefly explain how

Question : Subject: Digital security Briefly explain how Android 3.0 and later versions encrypt file and user data, and how encryption keys are derived. The response must be typed, single spaced, must be in times new rom ...

Identify and evaluate at least three considerations that

Identify and evaluate at least three considerations that one must plan for when designing a database. Suggest at least two types of databases that would be useful for small businesses, two types for regional level organi ...

1 potassium metal is very reactive with liquid bromine the

1. Potassium metal is very reactive with liquid bromine. The result of the reaction is the formation of a white ionic solid. Explain what happens to these elements when they form an ionic compound and write the formula f ...

Question suppose you are given two stacked s and twrite an

Question : Suppose you are given two stacked S and T. Write an algorithm to transfer all elements from S to T so that the top of S is the first to be inserted onto T, and the bottom of S ends up at the top of T.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As