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 20:10
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
The more powerful, 60 volt cables and the main power shut-off on an hev are both colored orange.
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
Use a software program or a graphing utility with matrix capabilities to solve the system of linear equations using an inverse matrix. x1 + 2x2 − x3 + 3x4 − x5 = 6 x1 − 3x2 + x3 + 2x4 − x5 = −6 2x1 + x2 + x3 − 3x4 + x5 = 3 x1 − x2 + 2x3 + x4 − x5 = −3 2x1 + x2 − x3 + 2x4 + x5 = 5
Answers: 3
question
Computers and Technology, 24.06.2019 10:00
Each time you save a document, you will need to type in the file type in which it should be saved you can select the save button to save it with the same file name if it has been previously saved you will need to select the location to save the file you will need to use the save as dialog box
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
Mathematics, 11.11.2019 00:31
question
Physics, 11.11.2019 00:31
question
English, 11.11.2019 00:31
question
Geography, 11.11.2019 00:31
Questions on the website: 13722363