Create a uml for a class called triangle

Assignment Help Basic Computer Science
Reference no: EM13691301

Create a UML for a class called triangle. It will have an argument constructor that sets the sides to be side 1 as 10, side 2 as 10 and side 3 as 10. It sets the height to 15.Note that side 3 is the base. It will have a method called setDimensions ( int s1, int s2, int s3, int h) as a void that will set the sides to any values passed and any height passed. It will have a method get Area() that will return the area of the triangle as a return type. it will have a method isEquilateral () as void that will display: Your triangle is an equilateral if all 3 sides are the same value, else it will say: Your triangle is not an equilateral. After creating the UML, create the java code.
Test the code by creating a tester file called TestTriangle, it will create one object t1 that will be the default triangle values. It will create object t2 that will use the setDimensions() method to set the values to 10,15, 20 for sides and 25 for height of triangle. Call the getArea () on t1 and display via main method: The area of the first triangle is 50. Then also call the isEquilateral on t1. Then call the getArea () for t2 and display via the main method: the area of the second triangle is _____. After that call the isEquilateral() for t2.

Reference no: EM13691301

Questions Cloud

Arc-lengths are greater than or equal : For all (smooth) polar curves r = f(θ), 0 ≤ θ ≤ π/2, with f(0) = 1 and f(π/2) = 1, and f(θ) ≥ 1 for all 0 ≤ θ ≤ π/2, show that their arc-lengths are greater than or equal to π/2.
How much would be saved by paying cash : A used motorcycle can be purchased for $500 cash or on credit with a $200 down payment plus payments of $70 per month for 5 months. How much would be saved by paying cash?
Factor the expression completely : Factor the expression completely
The expected returns on investment of the three stocks : The expected returns on investment of the three stocks
Create a uml for a class called triangle : Create a UML for a class called triangle.
The mft data block allocation algorithm : Write a program that implements the MFT data block allocation algorithm
How does sound waves travel to analyze : How does sound waves travel to analyze
Exception handling to deal with input or output errors : Exception handling to deal with input or output errors
Identify the number of days : Identify the number of days

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd