Question: Create a Java class called ExponentialValue that calculates the exponential value of a number. The user will provide the base and the exponent value. The

Create a Java class called ExponentialValue that calculates the exponential value of a number. The user will provide the base and the exponent value.

The base must be stored as a double. The exponent is an integer.

You are NOT allowed to use Math.pow() for this.

Your logic must also be able to handle negative exponents and negative numbers

Example 1:  base = 2.0 exponent = 2 output = 4.0 Example 2: base = -2.0 exponent = 3 output = -8.0 Example 3: base = 3.0 exponent = -2 output = 0.1111111111111111 Example 4: base = 2.0 exponent = 0 output = 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!