How to find if there is a " , " " ? " " ! " " ; " " . " in a list of characters the user must enter, I made a while loop and i broke it when the user enters any number from 0 to 9 ..
Sample run :
Enter any character (a digit 0-9 to stop): a B , R x u ! @ . C W 2
The list you entered contains 3 punctuations signs.
part of what i have done
int count = 1;
while ( count > 0 )
{
Scanner input = new Scanner(System.in);
System.out.print("Enter any character and a digit 0-9 to stop: ");
char ch = input.next().charAt(0);
if ( ch>=0 && ch<=9)
break;
}
original q. :
program that keeps prompting the user to enter a character different than a digit. The first digit entered by the user stops the input and the program should then display the number of punctuations characters entered (one of this list ! . , ; ?). When none is found, display a message “Characters entered without punctuation”.