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
Given a PrintWriter reference variable named output that references a PrintWriter object, write a statement that writes the stri
Nadya [2.5K]

Answer:

A PrintWriter reference variable named output that references a PrintWriter object is as follows:

//PrintWriter output = new PrintWriter(outfile);

PrintWriter output = new PrintWriter("output.txt");

The statement that writes the string "Hello World" to the file output is as follows:

//output.print(message)

output.print("Hello World");

Explanation:

4 0
3 years ago
What may happen if a large number of computer users are attempting to access a web site at the same time that you are
Nitella [24]
It will most likely begin to crash and eventually just freeze , i'm guessing  
6 0
3 years ago
Read 2 more answers
Which line of code will print I can code on the screen?
KIM [24]

Answer: print("I can code")

Explanation:

luckily im a coder

5 0
3 years ago
You use the Paste Options button labeled ____ if you want the pasted chart not to be linked to the source document and you want
Semenov [28]

Answer:

Keep Source Formatting & Embed Workbook

Explanation:

Source formatting is used to apply the formatting from source document while copying and pasting.

Source is the place where the data is already placed and we want to move it make a copy of it on some other document. So if we don't want to change the formatting of source document, we choose source formatting from the options while pasting.

Embed is used to whenever we don't want to link the formatting with source document.

So,

You use the Paste Options button labeled <u><em>Keep Source Formatting & Embed Workbook</em></u><em> </em>if you want the pasted chart not to be linked to the source document and you want the pasted chart to keep the formatting from the source document.

8 0
3 years ago
Read 2 more answers
Which devices are often used inside of tablets to store data on these devices?
My name is Ann [436]

Answer:

D

Explanation:

Current tables such as the new iPads use solid state drives to store data.

6 0
3 years ago
Other questions:
  • The concept of vertical farming allows agriculture to occur when there is not enough___Available .
    13·1 answer
  • How many people employed in the United States work in a job related to digital media?
    12·1 answer
  • When addictions escalate and the individual loses his or her job or drops out of school, _______________.
    12·2 answers
  • What color mode would you use when designing for web &amp; devices?
    9·1 answer
  • IN C++ PLEASE!!!! Define a function FilterStr() that takes a string parameter and returns "Good" if the character at index 4 in
    7·1 answer
  • One of the primary principles of the Rapid Application Development methodology is early prototyping of the _______ in the develo
    6·1 answer
  • I will have to goste yall im busting my butt off doing homework
    10·2 answers
  • What is the bandwidth for asymmetric digital subscriber line<br> (ADSL)?
    10·2 answers
  • (40 PTS) Be specific
    12·1 answer
  • The Texas Department of Education has offices throughout the state covering more than 268,000 square miles. State documents are
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!