1. Engineering
  2. Computer Science
  3. please answer in java language...

Question: please answer in java language...

Question details

I) (20 pts.) - This assignment will acquaint you with the use of parameter passing, return values, if/else blocks, and user inputs. You will create a program that prompts the user for a set of information, then executes simple algebra on those values and returns a summary report. Your program should perform the following: A) 2/20 pts.)-Prompt the user for a first shape B) 2/20 pts.)-Prompt the user for the first shapes dimensions 1) Triangles are assumed to be isosceles. C) 2/20 pts.)-Prompt the user for a second shape 1) Assume the first and second shape are different shape D) (2/20 pts.)-Prompt the user for the second shapes dimensions E) (6/ 20 pts.)-Calculate the shape areas and display the summary statement F) (4/20 pts.)-As an additional requirement, no method (including main) ) may contain more than 12 lines of instruction, discounting lines which only contain braces (Il), method headers, and comments. G) (2/20 pts.)-Include appropriate program documentation and formatting including: 1) Your first and last name 2) Your contact information 3) Your student ID number 4) The date 5) A short description of the programs function 6) Comments necessary to explain the operation of your program 7) Proper indentation II) A Sample log of execution is as follow (user inputs are in bold and underlined): Define a first shape (1) rectangle, 2) triangle, 3) circle): Rectangle width: 10 Rectangle Height: 50 Define a second shape (1) rectangle, 2) triangle, 3)circle) 3 Circle radius: 10 Rectangle area: 500.0 Circle area: 314.15The area of the rectangle seems bigger than the area of the circle. III) Optional Criteria: 1) Locate additional Java libraries to utilize a much more precise value of pi. 2) Since its conceivable that any number of shapes could be compared, improve the flexibility of your program by solving the problem without referencing dimensions unique to each shape type (such as radius, base, width, or height). Rather, create the correct output using firstShapeDimensionOne, “firstShape DimensionTwo, secondShapeDimensionOne, and secondShapeDimensionTwo variables IV) Tips: 1) The basic equation to calculate the area of a rectangle is Width x Height. 2) The basic equation to calculate the area of a triangle is (Base x Height)/2.0 3 ) The basic equation to calculate the area of a circle is (pi) x ( Radius) x ( Radius) 4) The value of 3.14159 may be used as a stand-in for pi. You may opt to use the Math.Pl class.field for a more precise value of pi if you wish.Please answer in Java language.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution