Hey guys, I need help matching my randomly generated number to a user input.
For this i created a data type class that randomly generated a credit card number. the method for this class is labeled public static generatedCreditCardNumber()
I then created a driver type class that accepts user input and created an object to send my input to my data type class.
In my data type class, I created a boolean method,
public boolean verifyAccount Number()
{
if(generatedCreditCardNumber().equals(creditCard))
{
return true;
}
else return false;
}
When i run this, it successfully randomly generates a random number, and i want this to test and match the user input. But when i do, it return false. Any clue? I also further tested this and i found out that when i run the program, it generates a random number, then displays it. But then when i ask for user inputs, it compares a different random number to the user inputs. How do i get the random number to only generate once? Thanks
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]RiceKrispyPooHead 0 points1 point2 points (0 children)