Pythagorean theorem to calculate the hypotenuse

Assignment Help Basic Computer Science
Reference no: EM131934548

Based on the previous exercise, please create the Triangle class:

  • the attributes or properties are: o base o height
  • the following methods: o setBase o setHeight o getBase o getHeight o getHypotenuse o getArea o getPerimeter
  • and 2 constructors

Remember this is a right triangle, so you can use the Pythagorean Theorem to calculate the hypotenuse. The hypotenuse will be used for the Perimeter calculation. When doing that calculation, please do not repeat the hypotenuse formula, use the method already defined in the class. Do not add any other properties nor methods to the class. Follow instructions. You should ask the user to enter a value for the height and base of two different triangles and then output the hypotenuse, area, and perimeter of each triangle. Each triangle object must be instantiated using a different constructor. For example, triangle using the constructor without parameters and triangle1 using the constructor with parameters.

Reference no: EM131934548

Questions Cloud

Import statement at the top of the program : The following code uses functions defined in my_funcs.py. Complete the import statement at the top of the program.
What are the main kinds of knowledge claim : What are the main kinds of knowledge claim that the authors are making? (e.g., Theoretical knowledge, research knowledge, practice knowledge?)
How can counselors help a client : How can counselors help a client to identify blind spots while continuing to provide empathy and support for the client?
Best performance in wireless communication : How many APs are needed and where they should be placed for best performance in wireless communication? List these factors.
Pythagorean theorem to calculate the hypotenuse : Remember this is a right triangle, so you can use the Pythagorean Theorem to calculate the hypotenuse.
What are some of primary issues that hector is addressing : What are some of primary issues that Hector is addressing? What are Hector's behaviors and how are these impacting his adjustment?
Significant driving force for new technology : What is the most significant driving force for new technology in the world today by explaining and giving two examples of technology
At the money put option on taggart stock is closest : The BlackScholes value of a one-year, at-the-money put option on Taggart stock is closest to:
Independent sales and marketing consultant : You have an acquaintance who is an independent sales and marketing consultant that is about to open a small consulting firm with three full-time employees.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Right to disobey a directive ordered

Hypothesize a situation in which a public administrator or employee should have the constitutional right to disobey a directive ordered by a superior.

  Find many faults in your code at compile time

Explain why the graph of Figure 8.19 can be interpreted to mean that if you find many faults in your code at compile time, you should throw away your code and write it again.

  Give what makes a computer system

Defines a computer and give what makes a computer system

  Draw a uml class diagram to justify your choice

Draw a UML class diagram to justify your choice.

  Elaborate on storage are networks (sans)

Elaborate on storage are networks (SANS). Be very granular with the post and tell how you would use this technology and give a realistic example.

  Discuss the assessment of software quality

You should consider each attribute in turn and explain how it might be assessed.

  Client of yours is concerned about external intrusion

Client of yours is concerned about external intrusion on their corporate network, and those inside their environment that they seek to fire! They've heard about firewalls and they need your professional opinion as to whether, with the implementation ..

  Code will work for the general case

MAKE SURE that your code will work for the general case, not just those cases shown.

  Does government spending create jobs

The Golden Gate Bridge is an international symbol of San Francisco. The bridge spans the entrance to San Francisco Bay from the Pacific Ocean.

  Options the company could have taken

Discuss what malware is and find examples (at least 2) of how a business was adversely affected by malware.

  Problems of understanding natural languages

Briefly discussed the problems of understanding natural languages as opposed to formal programming languages and describe how the problem of traveling from one city to another could be framed as a production system. What are the states? What are the..

  Write a statement to print the counter value

Write a For loop such that the loop till iterate from 1000 to 1 decrementing the counter by 1 each time through the loop. Inside the loop, write a statement to print the counter's value to the Output window.

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