Question: 2 . Write a Java program to take a number input from user using Input Dialog in JOptionPane class. Make a variable with a random
Write a Java program to take a number input from user using Input Dialog
in JOptionPane class. Make a variable with a random value of your choice.
And when user enters the value check if it is equal to the value of the variable you
made previously. Print successful or failure according to the condition.
In the previous program, make an addition that if the input is not equal to the randomly
stored variable, then keep on asking for input until the user enters correct value.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
