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
Skinner designed a soundproof apparatus, often equipped with a lever or bar, with which he conducted his experiments in operant
Jlenok [28]

Answer: Skinner box

Explanation: Skinner box is referred as the environment to conduct an experiment to observe the natural behavior of the element in a chamber. The Skinner box is also known as operant conditioning chamber. It is most commonly used for the experiments to be conducted with the animals in the operant conditioning chamber for the research purpose.

It is also soundproof tool and also refereed as the lever box as it contains lever .Thus the answer is Skinner box.

5 0
3 years ago
Java - Given a String variable response that has already been declared, write some code that repeatedly reads a value from stand
Rainbow [258]

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

   

    Scanner stdin = new Scanner(System.in);

    String response = "";

 while (true) {

     System.out.print("Enter the response: ");

     response = stdin.nextLine();

     

     if (response.equals("Y") || response.equals("y") || response.equals("N") || response.equals("n"))

         break;

 }

}

}

Explanation:

Create a string variable called response

Create a while loop that iterates until a condition is specified to stop

Inside the loop:

Ask the user for the input

Check if input equals "Y", "y", "N" or "n". If input equals any of these letters, stop the loop. Otherwise, continue asking for a new response

4 0
3 years ago
If the floating-point number representation on a certain system has a sign bit, a 3-bit exponent, and a 4-bit significand. What
vekshin1

Answer:

Normalization of storage is a typical method of storing the floating point number by shifting the decimal after the first figure of the number such as 1101.101 is normalized to 1.101101x23.

If the number that is in hovering point representation has 1 sign bit, 3-bit exponent with a 4-bit significant:

whenever the storage is normalized, then the biggest positive floating spot number in 2`s and the complement notation is 0.11112 x 23 = 111.12 =7.5

If the storage is returned to normal, then the minimum positive floating point number is 0.12 x 2-4 =0.000012 =1/32 = 0.03125.

Explanation:

Whenever the floating figure is keyed into the computer memory, then the first bit will be the sign bit, the next 8 bits are for exponent and 23 bits are used for storing significand. The array of exponents is from -127 to 128. While Exponent 127 stands for 0 and positive figures can be represented by values bigger than 127. The biggest floating point number will be represented as 0.111111.... 1111x 211111111

7 0
4 years ago
Which of the following is NOT a factor to consider when examining extrinsic job satisfaction?
Nezavi [6.7K]
The answer is Job tasks.
4 0
3 years ago
A company is deploying a file-sharing protocol across a network and needs to select a protocol for authenticating clients. Manag
VARVARA [1.3K]

Answer:

The answer is "Option C".

Explanation:

Among all four of the above, the application of Kerberos is securer. The consumer not just to validates the provider but also verifies the product to the clients with secure authentication.  

  • It offers a common interface between windows as well as other operating systems.  
  • The user login Smart Card gives much higher protection as it allows security with two factors, that's why except Option C other choices were wrong.
6 0
3 years ago
Other questions:
  • whats something that u want to do but ur parents wont allow it like having a phone or going to a college ​
    11·2 answers
  • 535 = d +4<br> Whats d?????????????????????<br> &lt;33 thnx babes.
    8·2 answers
  • A user has requested to have an extra 4GB of memory installed on a laptop. During the Installation process, which of the followi
    6·1 answer
  • The different types of DDR modules are easily identifiable because of what factor?
    8·2 answers
  • Ok so sometimes when i do something i see a box with a question mark in it, how do i remove it, i am on a macOs High Sierra earl
    11·1 answer
  • Which of the following is an example of batch processing?
    14·1 answer
  • Create another method: getFactorial(int num) that calculates a Product of same numbers, that Sum does for summing them up. (1,2,
    7·1 answer
  • Which option should you select to ignore all tracked changes in a document? To ignore all tracked changes in a document, you sho
    14·1 answer
  • If you were an architect planning on building a large scale Municipal complex what type of engineer would you identify as essent
    10·1 answer
  • 1.Blocul care asigura impedanta necesara la intrarea aparatului de masurat numeric este:
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!