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
iVinArrow [24]
3 years ago
5

Write a program named CountVowelsModularized that passes a string to a method that returns the number of vowels in the string.

Computers and Technology
1 answer:
KengaRu [80]3 years ago
7 0

Answer:

<em>import java.util.Scanner;</em>

<em>public class CountVowelsModularized {</em>

<em>    public static void main(String[] args) {</em>

<em>        Scanner in = new Scanner (System.in);</em>

//Prompt user to enter a string, receive it and assign to a variable<em>        </em>

<em>System.out.println("Enter a string Value");</em>

<em>        String word =in.nextLine();</em>

//Calling the method numVowels and passing the string

<em>        System.out.println("The Number of vowels are " +numVowels(word.toLowerCase()));</em>

<em>    }</em>

<em>}</em>

The method definition and complete program is given in the explanation section<em> </em>

Explanation:

<em>import java.util.Scanner;</em>

<em>public class CountVowelsModularized {</em>

<em>    public static void main(String[] args) {</em>

<em>        Scanner in = new Scanner (System.in);</em>

<em>        System.out.println("Enter a string Value");</em>

<em>        String word =in.nextLine();</em>

<em />

<em>        System.out.println("The Number of vowels are " +numVowels(word.toLowerCase()));</em>

<em>    }</em>

<em>    public static int numVowels(String string) {</em>

<em>        int counter = 0;</em>

<em>        for (int i = 0; i < string.length(); i++) {</em>

<em>            if (string.charAt(i) == 'a' || string.charAt(i) == 'e' || string.charAt(i) == 'i'</em>

<em>                    || string.charAt(i) == 'o' || string.charAt(i) == 'u') {</em>

<em>                counter++;</em>

<em>            }</em>

<em>        }</em>

<em>        return counter;</em>

<em>    }</em>

<em>}</em>

You might be interested in
Calls to the tostring( ) method emphasize the use of ____.
DaniilM [7]
<span>Polymorphic message
   
Methods in different classes with a similar function are given the same name. - Makes classes easier to use because programmers need to remember fewer method names. - Employed as much as possible. - Polymorphic message ex. is the toString method.</span>
5 0
2 years ago
6
Lisa [10]

Answer C in the paragraph group on the home tab

8 0
2 years ago
What kind of block do you need to check whether a sprite is touching another sprite?
Mila [183]

A event block i know this im i have been in technology for 5 months

7 0
2 years ago
What is an 8086 microprocessor used for
Liula [17]
A sixteen bit microprocessor chip used in early IBM PCs. The Intel 8088 was a version with an eight-bit externaldata bus.

The Intel 8086 was based on the design of the Intel 8080 <span>and </span>Intel 8085 (it was source compatible with the 8080)with a similar register set, but was expanded to 16 bits. The Bus Interface Unit fed the instruction stream to theExecution Unit through a 6 byte prefetch queue, so fetch and execution were concurrent - a primitive form ofpipelining (8086 instructions varied from 1 to 4 bytes).

It featured four 16-bit general registers, which could also be accessed as eight 8-bit registers, and four 16-bit indexregisters (including the stack pointer). The data registers were often used implicitly by instructions, complicatingregister allocation for temporary values. It featured 64K 8-bit I/O (or 32K 16 bit) ports and fixed vectored interrupts.There were also four segment registers that could be set from index registers.

The segment registers allowed the CPU to access 1 meg of memory in an odd way. Rather than just supplyingmissing bytes, as most segmented processors, the 8086 actually shifted the segment registers left 4 bits and addedit to the address. As a result, segments overlapped, and it was possible to have two pointers with the same valuepoint to two different memory locations, or two pointers with different values pointing to the same location. Mostpeople consider this a brain damaged design.

Although this was largely acceptable for assembly language, where control of the segments was complete (it couldeven be useful then), in higher level languages it caused constant confusion (e.g. near/far pointers). Even worse, thismade expanding the address space to more than 1 meg difficult. A later version, the Intel 80386, expanded thedesign to 32 bits, and "fixed" the segmentation, but required extra modes (suppressing the new features) forcompatibility, and retains the awkward architecture. In fact, with the right assembler, code written for the 8008 canstill be run on the most <span>recent </span>Intel 486.

The Intel 80386 added new op codes in a kludgy fashion similar to the Zilog Z80 and Zilog Z280. The Intel 486added full pipelines, and clock doubling (like <span>the </span>Zilog Z280).

So why did IBM chose the 8086 series when most of the alternatives were so much better? Apparently IBM's own engineers wanted to use the Motorola 68000, and it was used later in the forgotten IBM Instruments 9000 Laboratory Computer, but IBM already had rights to manufacture the 8086, in exchange for giving Intel the rights to its bubble memory<span> designs.</span> Apparently IBM was using 8086s in the IBM Displaywriter word processor.

Other factors were the 8-bit Intel 8088 version, which could use existing Intel 8085-type components, and allowed the computer to be based on a modified 8085 design. 68000 components were not widely available, though it could useMotorola 6800 components to an <span>extent.
</span>
Hope this helps
7 0
3 years ago
Which statement describes a printer driver? a) It is the configuration code that is sent to a printer to identify the operating
White raven [17]

Answer:

Option (b) is the correct and suitable answer for the above question.

Explanation:

The printer is a hardware which is used to convert the soft copy of an information to a printed copy (Hard copy) of information.

To use printer hardware a computer system needs a printer driver which is used to do the conversion from soft copy to a hard copy. Hardware printer uses only for the purpose to print the copy.

The option b says that the printer driver is used to convert the document into the form of that document which the printer can understand easily. It means conversion from soft copy to hard copy. Hence it is the right option.

The reason behind the other option which is not valid because--

Option a says that the printer driver is a code but it is a software.

Option c says that the printer driver is an interface but it is a software.

Option d says that the printer driver is a cache but it is a software.

4 0
2 years ago
Other questions:
  • What should not be compromised when trying to meet standards and deadlines?
    12·1 answer
  • Which of the following are examples of algorithms? (Select all that apply, if any do.)
    15·2 answers
  • How is typing speed measured
    12·2 answers
  • How do headphones work? (From pc)
    8·1 answer
  • Write the definition of a function named printstarbucks that receives a non-negative integer n and prints a line consisting of n
    6·1 answer
  • The mobile nodes (devices) add or leave a Mobile Ad-hoc Network, changing the _____ of this network over time. a) infrastructure
    14·1 answer
  • What is Naptha used for?
    9·2 answers
  • Help please not trying to fail
    13·1 answer
  • Write a function sumOfMultiples, that inputs two integers - seed and cap. The function should return the sum of all the multiple
    6·1 answer
  • When creating an HTML document, what do we use to set aside space for content?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!