Java Programming: Enter a sentence, tells you if each letter is Upper or lower c

So this is what I must have…Write a program that prompts user to enter a sentence. The program should display each character on the screen except space character (‘ ‘). For each character, there are three possible outputs to display; ‘Upper case’, ‘Lower case’, and ‘Not a letter’. Note that if the character is a space character, then you do not display space character, and you do not display any of the three possible outputs. Also there must not be a blank line. The program also must show total letter count, total lower case count, and total upper case count. For the total letter count, do not include the space characters, or Non-letter characters. You must write two classes; LetterCase and LetterCounter. LetterCase class must have the following; isThisSpace : Takes a char parameter, returns true if the parameter is a space character. isThisUpperCase : Takes a char parameter, returns true if the parameter is upper case. isThisLowerCase : Takes a char parameter, returns true if the parameter is lower case. main : You must create a LetterCounter object in main method. Read in a sentence from the user. To iterate the characters of the sentence, you must use for loop. In each iteration, call the boolean methods above. Then change the status of the counter if necessary. Then display the letter counts. LetterCounter class must have the following; Default constructor. getUpperCount : returns uppercase count (int). Make this method private. getLowerCount : returns lowercase count (int). Make this method private. increaseUpperCount : increases by one. increaseLowerCount : increases by one. displayCounts: displays three lines as in the screenshot. Call getUpperCount and getLowerCount methods. And the required output.

Looking for this or a Similar Assignment? Click below to Place your Order

Open chat
%d bloggers like this: