I’ve been stuck with this problem. I want a certain variable to accept numbers only. If a user input a letter, number with letter or letter with number it will be ask again to enter a number. Here’s my code so far. It works when the user inputs a letter or a letter before a number but when you put the number first before the letter it still proceed to ask the next question. Please help me out. I’m still a beginner.
Here’s my code so far:
I’ve tried using while loop but it doesn’t seem to work. I used double instead of int since it’s a coding on how a calculator works
Beginner is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
10