Introduction to Programming with Java

Affordable Essays
Question

a. Write a Java class (program) that reads from the user a real number represents the length of the

hypotenuse of an isosceles right triangle. Then calculates and prints the area of this triangle (rounded to 2

decimal places). [9 marks] Hint: You can search the internet to discover how to calculate the area of an

isosceles right triangle when you only know the length of its hypotenuse.

b. Give the exact output of your program. Provide a snapshot representing the exact output of any value from

your choice. [1 mark]

Question Two: [24 marks]

a. For any quadratic equation: , there are zero, one or two real solutions. Write a Java application that

reads from the user 3 integers represent the values of the coefficients of a quadratic equation (a, b and c).

Then computes and prints how many real solutions for the given equation. In addition, if the user enters 0 as

the value of a, a suitable error message should be displayed and nothing should be computed. [20 marks]

Hints:

ï‚· It is not required to compute the real solutions. Just compute number of them.

ï‚· You can search the internet to discover when a quadratic equation has zero, one or two real solutions.

b. Give the exact output of your application. Give 4 snapshots representing the exact output of 4 different

cases (i.e., when the number of real solutions is 0, 1, 2 and when the user enters 0 as the value of a). [4

With unimasteressays.com’s essay writing service, you can always rest easy knowing that when you say “write my essay”, you will get a superior quality plagiarism-free, professionally written paper. Just proceed and place an ORDER NOW.

Do You Need A Similar Assignment?

Place an order with us. Our skilled and experienced writers will deliver a custom paper which is not plagiarized within the deadline which you will specify.

Note; 6 Hours urgent orders deliver also available.

If you need more clarifications contact our support staff via the live chat for immediate response.

 

Type of paper Academic level Subject area
Number of pages Paper urgency Cost per page:
 Total: