1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Viefleur [7K]
3 years ago
13

Complete the program below named CountVowels so that it reads in a string, counts all the vowels in that string, and prints out

the number of vowels in the string.
For example, given the input string of "Hello, World!", the program should print out the value 3 for the three vowels, "eoo", in that string.
Complete the following file:
CountVowels.java
import java.util.Scanner;
/**
Reads a string and counts all vowels contained in that string.
Vowels are A E I O U a e i o u.
Input: the value of s, a string
Output: the number of all the vowels in s
*/
public class CountVowels
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
String s = in.nextLine();
// your work here
System.out.println(count);
}
}
Computers and Technology
1 answer:
Kobotan [32]3 years ago
5 0

Answer:

Answered below

Explanation:

public class CountVowels{

public static void main (String[] args){

Scanner in = new Scanner(System.in);

String words = in.nextline();

String vowels = "aeiouAEIOU";

int count = 0;

for( int i =0; I< words.length-1; I++){

for( int j = 0; j < vowels.length - 1; j++){

if(words [I] == vowels[j]){

count++;

}

}

}

System.out.print(count);

}

}

You might be interested in
python Create a new qualitative variable, called Elite, by binning the Top10perc variable. We are going to divide universities i
Studentka2010 [4]

Answer:

import pandas as pd

# URL for university excel sheet( CSV format)

data_url = '' "

# Load the data from University URL

university = pd.read_csv(data_url)

# filter the data to contain universities from where more than 50 students out of the top 10% of their high school classes came

university_1 = university[universty.number>50 ]

n= len(university_1)

n1= (10 *n)/100

university_1.nlargest(n1, 'number')

print(university_1)

Explanation:

We are using here Pandas. And it is meant for reading from various data sources like Excel, Acess, SQL Server, etc. And first, we filter University with student number more than or equal to 50. Finally, with the nlargest, we find the top 10% of the list. And for running the above program we only need to add the URL of the university.csv. Nothing else is required. You can have the local file address as well if the CSV is on your computer.

7 0
3 years ago
The first thing you should select if you're using an Address Block or Greeting Line is
KonstantinChe [14]

The very first thing that we should select if we are using an address Block or Greeting Line is to Start Mail Merge. The second step would be to Edit Recipient List.  In the Mail Merge Recipients dialog box, we then select the  recipient whose record is to be included in the merge.

5 0
3 years ago
How many bytes of information can be stored on a hard drive?
CaHeK987 [17]
1,073,741,824 bytes.
3 0
3 years ago
Can someone help me with these two
Digiron [165]

upper question:

false

lower question:

25

26

-10

7 0
3 years ago
____ computers are used by large businesses, government agencies, and in science and education to provide centralized storage an
Charra [1.4K]

The answer to this question is the Mainframe Computer. Mainframe computers are used by large businesses, and government agencies because this computer can store large data and information. Mainframe basically known as a large cabinet because of its size and the frame stores the Central processing unit of the computer.  

3 0
4 years ago
Other questions:
  • Where is the brightness and contrast changed at?
    10·2 answers
  • Many computer users and some operating systems call subdirectories ____.
    10·1 answer
  • Siona needs to make sure her ads are getting a minimum number of impressions on the top of the page. What type of automated bidd
    10·1 answer
  • With ______________, the cloud provider manages the hardware including servers, storage, and networking components. The organiza
    6·1 answer
  • If a CPU receives theinstruction to multiply the byte-sized values $12 and $3E, thisaction will take place in the ______________
    13·1 answer
  • In what situation is a read receipt notification not sent when an email is opened or previewed bya recipient?
    8·2 answers
  • When power is completely removed from your computer
    11·1 answer
  • Tools used to type text on Ms -paint​
    10·1 answer
  • How do cybercriminals use JavaScript maliciously?
    11·1 answer
  • How is video compression accomplished?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!