subject

Write a class 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: The user is asked to enter a string.
The program displays the following menu:
Count the number of vowels in the string
Count the number of consonants in the string
Count both the vowels and consonants in the string
Enter another string
Exit the program
The program performs the operation selected by the user and repeats until the user selects e, to exit the program.
CHANGES:
-- Instead of Vowels, you will be finding numbers and instead of consonants, you will be finding spaces. We will also be finding substrings. We will call our version "Numbers, Spaces & Substrings".
#2a should now say "Count the number of numbers in the string'
#2b should now say "Count the number of spaces in the string"
#2c should now say "Count the number of times a substring appears in the string"

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:00
Which best describes the condition under which the unicode output is the same as plain text?
Answers: 3
question
Computers and Technology, 23.06.2019 10:50
The volume v and paper surface area a of a conical paper cup are given by where r is the radius of the base of the cone and h is the height of the cone. a. by eliminating h, obtain the expression for a as a function of r and v. b. create a user-de ned function that accepts r as the only argument and computes a for a given value of v. declare v to be global within the function. c. for v ! 10 in.3 , use the function with the fminbnd function to compute the value of r that minimizes the area a. what is the corresponding value of the height h? investigate the sensitivity of the solution by plotting v versus r. how much can r vary about its optimal value before the area increases 10 percent above its minimum value?
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
question
Computers and Technology, 24.06.2019 14:00
Text or graphics that print at the bottom of every page are called footings footers headers headings
Answers: 1
You know the right answer?
Write a class with a constructor that accepts a String object as its argument. The class should have...
Questions
question
Geography, 21.02.2020 03:57
question
Mathematics, 21.02.2020 03:57
question
Social Studies, 21.02.2020 03:58
Questions on the website: 13722363