Write a program that reads characters from the keyboard until a period is
received. Have the program count the number of spaces and display it to the
user. After that, ask the user if he/she would like to count a specific character.
Terminate when the user is done counting the characters.
plzzz help me
1 Year Ago
Related Article:Best Book to learn Java-EE and COre java
is a Java discussion thread by chiiqui that has 1 reply, was last updated 1 year ago and has been tagged with the keywords: core-java, corejava, j2ee, java, java-ee, javaee.
what help do you need?
you know what to do, the only thing you need to actually create and test that application is a keyboard, and since you've been able to write that post, I 'm pretty sure you already have one.
show us the code you've written and where you 're stuck, but we're not going to write code-on-demand.
public class Characters
public static void main(String args)
Scanner input = new Scanner(System.in);
int spaces = 0;
System.out.println("Enter . to stop.");
while(ch != '.')
ch = (char) System.in.read();
System.out.println("number of spaces : "+spaces);
System.out.println("would like to count a specific character(yes or no) : ");