/*
(count vowels and consonants) assume letters a, e, i, o, and u as the vowels.
write a...
Computers and Technology, 30.10.2019 23:31 venuscagle
/*
(count vowels and consonants) assume letters a, e, i, o, and u as the vowels.
write a program that prompts the user to enter a string and displays the number
of vowels and consonants in the string.
*/
import java. util. scanner;
public class exercise_05_49 {
public static void main(string[] args) {
scanner input = new scanner(system. in);
// prompt the user to enter a string
system. out. print("enter a string: ");
string string = input. nextline();
int vowels, // count the number of vowels
consonants; // count the number of consonants
vowels = consonants = 0; // initialize accumulators to 0
// count the number of vowels and consonants
for (int i = 0; i < string. length(); i++) {
if (character. isletter(string. charat( {
if (character. touppercase(string. charat(i)) == 'a' ||
character. touppercase(string. charat(i)) == 'e' ||
character. touppercase(string. charat(i)) == 'i' ||
character. touppercase(string. charat(i)) == 'o' ||
character. touppercase(string. charat(i)) == 'u') {
vowels++;
}
else
consonants++;
}
// display results
system. out. println("the number of vowels is " + vowels);
system. out. println("the number of consonants is " + consonants);
}
}
Answers: 2
Computers and Technology, 22.06.2019 16:10
When copying and pasting text, the first step is move your cursor type the text select the copy command select the paste command
Answers: 2
Computers and Technology, 22.06.2019 17:30
Type the correct answer in the box. spell all words correctly. under which key category do the page up and page down keys fall? page up and page down keys fall under the keys category.
Answers: 3
Computers and Technology, 22.06.2019 20:00
Need asap assignment directions: think of an organization (business, religious institution, volunteer organization, sports team) with which you have been involved. imagine outfitting it with an it infrastructure. prepare a plan for what you would do to support outfitting it. draw a map of a network connecting all the individuals, give them pcs and printers, and lay out the design as best you can. the purpose is to begin working with these concepts, not to build a perfect network.
Answers: 2
Computers and Technology, 24.06.2019 06:30
Some peer-to-peer networks have a server and some don't. true false
Answers: 2
Biology, 15.01.2021 04:40
History, 15.01.2021 04:40
Arts, 15.01.2021 04:40
Mathematics, 15.01.2021 04:40
Mathematics, 15.01.2021 04:40
Physics, 15.01.2021 04:40
Geography, 15.01.2021 04:40
Mathematics, 15.01.2021 04:40
Engineering, 15.01.2021 04:40
Mathematics, 15.01.2021 04:40
Mathematics, 15.01.2021 04:40