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

  Extra credit for database project wk

Extra Credit for Database Project wk8

  What is the longest possible time between customer arrivals

What is the longest possible time between customer arrivals and how much time on average did a customer spend in the system

  Write method determines pair integers whether multiple first

Write method multiple that determines, for a pair of integers, whether the second integer is a multiple of the first. The method should take two integer arguments and return true if the second is a multiple of the first and false otherwise.

  Derive and estimate the error

Derive and estimate the error of Simpson's 3/8 Rule using the Newton's Interpolating Polynomials.

  Explain utilitarian theory tells us about the morality

What do you believe utilitarian theory tells us about morality of such questions as abortion, capital punishment, or euthenasia? Is utilitarian theory helpful in deciding these questions?

  Given a scanner of double values

public double[] stats(Scanner scanner) Given a Scanner of double values, return an array of capacity three that has the maximum value in the Scanner as the value in result[0]

  Finding whether two machines are equivalent

Consider the problem of finding whether two of these machines are equivalent. Formulate this problem as the language, and illustrate that it is undecidable.

  Write for loops to produce the following output

Write for loops to produce the following output

  Discuss the process for creating xml documents

Discuss the process for creating XML documents and apply this knowledge to develop XML and DTD documents.

  Design a program that prompts the user to enter a number

Design a program that prompts the user to enter a number within the range of 1 to 10. The program should display Roman numeral version of that number. If the number is outside the range of 1 to 10, the program should display an error message.

  Centralized and distributed computing architectures

"Centralized and Distributed Computing Architectures" Please respond to the following:

  The execution of the preceding two processes

Show all the possible interleaving of the execution of the preceding two processes.

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