Your program should use a while loop


Write a Java program that asks the user to enter two numbers x and b using Scanner and calculates logb(x), displaying the result using System.out.
Note that the Math.log(x) function returns the natural logarithm of x (ln(x)), so you will need to use the formula
logb(x) =ln(x)/ln(b)

Your program should use a while loop (or a do-while loop) to continually ask the user for input until two valid numbers are entered. A number is considered valid if it is greater than zero.
Ask the user to enter the value of x. If the input is not valid then print an appropriate error message and ask for x again. Continue asking until a valid value for x is provided.
Repeat the same process as above, but asking the user for b instead of x.
Once both numbers are input calculate logb(x) and display the result with System.out. 

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Your program should use a while loop
Reference No:- TGS089159

Expected delivery within 24 Hours