Course Solutions Uncategorized (Solved) : Java Add Static Method Computes Area Several Common Shapes Triangle Rectangle Parallelogra Q30485310 . . . .

(Solved) : Java Add Static Method Computes Area Several Common Shapes Triangle Rectangle Parallelogra Q30485310 . . . .

 

IN JAVA:

Add a static method which computes the area of several commonshapes: triangle, rectangle and parallelogram. The class shouldhave a single static method called printArea that takes inthree parameters: an enum for the shape type, a double for the baseand a double for the height.

Your program will first ask the user to type in a shape (square,parallelogram, triangle) , base and height via the console. Then,use an IF-ELSE statement to call the printArea() method with theappropriate parameters.

As a reminder, the equations for area for the above shapes is:areasquare = bh

areaparallelogram = bh areatriangle = bh*(1/2)

Your printArea method will be static,

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : 4 1 Pt Flu Virus Simulation Update Function Takes Current Matrixrepresenting Health States Q28128226 . . . .(Solved) : 4 1 Pt Flu Virus Simulation Update Function Takes Current Matrixrepresenting Health States Q28128226 . . . .

<br/><img src="https://media.cheggcdn.com/media%2F990%2F990c5094-b0a1-47ad-b3b7-2c3d12585c96%2Fimage" alt="4. (1 pt) In our flu virus simulation, the update function takes the current matrixrepresenting the health states of the population and computes and returns a new matrix