Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer in Java language. I) (20 pts.) - This assignment will acquaint you with the use of parameter passing, return values, if/else blocks, and

image text in transcribedimage text in transcribedPlease answer in Java language.

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 shape's 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 shape's 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 program's 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.15 The 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 it's 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

IBM Db2 11 1 Certification Guide Explore Techniques To Master Database Programming And Administration Tasks In IBM Db2

Authors: Mohankumar Saraswatipura ,Robert Collins

1st Edition

1788626915, 978-1788626910

More Books

Students also viewed these Databases questions

Question

What are SMART goals?

Answered: 1 week ago

Question

=+60-3 Describe the four components of emotional intelligence.

Answered: 1 week ago

Question

Does it have correct contact information?

Answered: 1 week ago