Programming assighment

timer Asked: Apr 19th, 2015

Question description

Write a class  that has three overloaded static  methods  for calculating the areas of the
following geometric shapes:

• circles -- area = π*radius^2 (format the answer to have two decimal places)
• rectangles -- area = width * length
• trapezoid -- area = (base1 + base2) * height/2

Because the three methods  are to be overloaded, they should each have the same name , but
different parameters  (for example, the method  to be used with circles should only take
one parameter , the radius of the circle).

Demonstrate the methods  by adding a main method  that prints out the following areas, each on a
separate line:

• the area of a circle with radius 3
• the area of a rectangle with length 2 and width 4
• the area of a trapezoid with base lengths 3 and 5 and height 5


--- Prompts For Keyboard/Console/Standard Input ---



--- Monitor/Console/Standard Output  ---


What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java Area

Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors