In this Java code. I want to use a if statement instead of a try and catch variable inside of the while loop. How would I fix the code to that standard, and have the user run it as many times as they want until the user types a keyword to end the program. The attached photos are what I have so far. Also this is what my professor requires: This program is going to give us a chance to learn how to use "if" statements and take time to plan out the steps that we want to do things. Here is our task at hand... We need to have a program that will let the user enter a base value and an exponent value. They will pick from a menu to let the program which of the 5 choices they want to test We are going to get to use a built-in Math function to make this program work pow(). You will only be able to use the pow() function with a positive integer exponent with the choice that has a fractional exponent. You also will have that no negative base values will be entered along with a fractional exponent. But for the other scenarios the base can be a negative number. Your program must let the user test each choice from menu without having to restart the program. The output must look similar to the following: The base 6.35 raised to the power of 3/4 is 4.0001869986.
In this Java code. I want to use a if statement instead of a try and catch variable inside of the while loop. How would I fix the code to that standard, and have the user run it as many times as they want until the user types a keyword to end the program.
The attached photos are what I have so far.
Also this is what my professor requires:
This program is going to give us a chance to learn how to use "if" statements and take time to plan out the steps that we want to do things.
Here is our task at hand...
We need to have a program that will let the user enter a base value and an exponent value.
They will pick from a menu to let the program which of the 5 choices they want to test
We are going to get to use a built-in Math function to make this program work pow().
You will only be able to use the pow() function with a positive integer exponent with the choice that has a fractional exponent.
You also will have that no negative base values will be entered along with a fractional exponent. But for the other scenarios the base can be a negative number.
Your program must let the user test each choice from menu without having to restart the program.
The output must look similar to the following:
The base 6.35 raised to the power of 3/4 is 4.0001869986.
Step by step
Solved in 3 steps