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

  Suppose that you are connected to a database termed

assuming that you are connected to a database called computers.mdb with the fields computer hostname roomnum cputype

  Writing quality and formal structure of the paper

Writing Quality and formal structure of the paper

  Convert the cfg to chomsky normal form

convert the CFG to Chomsky Normal Form(CNF). convert this CFG to one with-out the lambda-Production then....

  Create a new file called testwork

Create a new file called TestWork.scr Change the permissions on this new file to add the execute bit for user, group, and owner.

  Write a condition to test

write a condition to test if the point is outside the rectangle. Assume that x increases to the right and that y increases to the top.

  Write a proof that uses this approach

An alternative proof of the irrationality of square root of 2 counts the number of 2's on the two sides of the equation 2n^2 = m^2 and uses the unique factorization of integers theorem to deduce a contradiction. Write a proof that uses this approa..

  Find the transmission rate in bits per second

Suppose all headers (including RTP, UDP and IP) have a total length of h and an IP datagram is emitted every 40 msecs.

  Traditional approach or a type of agile approach

When evaluating a proposal for acquisition and sourcing, are there considerations that are unique in the case of an IT project versus a non-IT project?

  Explain ibm plan to give its it assets-intellectual property

Will IBM's plan to give away some of its IT assets and intellectual property also increase its support of open-source software products like Linux.

  Create application to declares array of ten houseplant

Design an application that declares an array of 10 HousePlants. Prompt the user for data for each of the HousePlants, then display all values.

  Create a database schema that supports the companys business

Create a database schema that supports the companys business and processes - Explain and support the database schema with relevant arguments that support the rationale for the structure.

  Recommend two 2 factors which would affect the decision to

suggest two 2 factors that would influence the decision to disable bridge all site links as part of the site

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