Question
Java Write a class (called Lotty) with a constructor that accepts a String object as its argument. The class should have a method that returns
Java
Write a class (called Lotty) with a constructor that accepts a String object as its argument. The class should have a method that returns the number of vowels in the string and another method that returns the number of consonants in the string. Demonstrate the class in a program that performs the following steps:1.The user is asked to enter a string; 2.The program displays the following menu: A.Count the number of vowels in the string; B.Count the number of consonants in the string. C. Enter another string; D. Exit the program. 3.The program performs the operation selected by the user and repeats until the user selects D, to exit the program. Deliverable Submit a single pdf document containing pseudocode, UML class diagram (for the standalone class), code and testing (output in the console).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started