Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

return Create a public method that will return the area of a triangle. The parameters for base and height should allow for decimal values. In

image text in transcribed
return Create a public method that will return the area of a triangle. The parameters for base and height should allow for decimal values. In the body, first multiply the base times height, then divide by 2 (or multiply by .5). Return the answer. For example, if the base is 3 and the height is 10 = (3.10)/2 = 15. Answer: public double Create a public method that will return the area of a circle. Allow for decimal values to be passed in and returned. For the value of pi, use a literal value of 3.14. The body will square the radius value (passed in as a parameter) and then multiply by 3. 14. Return the answer. For example, if the radius is 6 = (6*6)*3.14 = 113.04. Answer: 3) Create a public method that will return the cubed value of a number. The parameter should only accept integer values. Multiply the parameter 3 times to return the cubed value. For example, if the number is 4 = 4 * 4 * 4 = 64. Answer: 4) Create a public method that will return the amount of sales tax on an order. To calculate the sales tax we need to know the amount of the order, and the sales tax percentage. Accept both of these parameters as decimal values. We will then multiply the amount by the percentage to determine the sales tax amount. For example, if the order anount is 16.75, and the tax percentage is 0.88 = 16.75 0.88 = 1.34 of sales tax on this order. Answer: MacBook Air

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

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions