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

Write a recursive, bool-valued function, containsVowel, that accepts a string and returns true if the string contains a vowel. A

string contains a vowel if: The first character of the string is a vowel, or The rest of the string (beyond the first character) contains a vowel
Computers and Technology
1 answer:
Tpy6a [65]3 years ago
3 0

Answer:

The method definition to this question as follows:

Method definition:

bool containsVowel (string s1) //define method.  

{

bool value=false; //define bool variable and assign value.

//check conditions.

if (s1.length()==0) //if block

{

   return false; //return value

}

else if (s1[0]=='a'||s1[0]=='e'||s1[0]=='u'||s1[0]=='o'||s1[0]=='i'||s1[0]=='A'||s1[0]=='E'||s1[0]=='U'||s1[0]=='O'||s1[0]=='I') //else if block

{

value=true; //return value.

}

else //else block

{

value = containsVowel(s1.substr(1,s1.length()-1));//calculate value  

return value; //return value.

}

}

Explanation:

In the above code, we define a bool method that is "containsVowel" in this method we pass the string variable that is "s1". Inside a method, we define a bool variable that is "value" and conditional statement that checks in the passed value there is a vowel or not.

  • In if block, we check that pass variable value length is equal to 0. if this condition is true it will return a false value.
  • Then we use else if block in this block we check that if value first letter is vowel to check this condition we use OR logical operator. if this condition is true it will change the variable value that is "true".
  • In the else block we use the value variable that uses the function to check that in passed value there is a vowel if this is true it returns its value.

You might be interested in
Which software package allows developers to deploy applications using the exact same environment in which they were developed?
Elanso [62]

The software that allows developers to deploy applications using the exact same environment in which they were developed is docker. The correct option is A.

<h3>What is a software package?</h3>

An assortment of files and data about those files makes up a software package. Linux's distributions are typically set up as individual software packages, each of which contains a specific program, like a web browser or a development environment.

Docker is a platform of service products that uses visualization of OS. Develops the shipping and running application.

Thus, the correct option is A. Docker.

To learn more about the software package, refer to the link:

brainly.com/question/18523054

#SPJ4

The question is incomplete. Your most probably complete question is given below:

A. Docker

B. Git

C. Bitbucket

D. Gitlab

6 0
2 years ago
Question 10 of 10
AnnyKZ [126]

Answer:

Explanation:B.

just took the test

3 0
3 years ago
A computer processor can become extremely hot and must be cooled. A heat sink is placed on top of the processor to extract its h
Schach [20]
Hello,

The Answer would be Metal
5 0
3 years ago
Finish the sentence. If the IP address and MAC address are parameters of layer 3 and layer 2, respectively, a port number is a p
stepan [7]

Answer:

Layer 4

Explanation:

MAC address works at the data link layer (layer 2) of the OSI model. Mac address allows computers to uniquely identify themselves in the network

IP Address is a logical address that works at the network layer of OSI model (layer 3) (actually the IP layer of TCP/IP model).

The port number works at the transport layer of the OSI model (layer 4).The port number uses sequence number to send segments to the correct application thereby ensuring they arrive in the correct order.

7 0
3 years ago
When you assign a value to an int variable, you do not type any commas; you type only digits and an optional plus or minus sign
worty [1.4K]
Negative integer is the correct answer
7 0
4 years ago
Other questions:
  • In the 1950s, the three major networks (ABC, NBC, and CBS) developed prime-time shows that would appeal to a general family audi
    11·1 answer
  • Which Boolean operator enables you to exclude a search term?
    9·2 answers
  • Select two netiquette guidelines. In a paragraph of no less than 125 words, explain why these guidelines make professional onlin
    9·1 answer
  • The company currently runs 60 autonomous APs and has plans to increase wireless density by 50% in the near future
    13·1 answer
  • Sam plans to use this image in artwork for a brochure about airplanes. Which principles of page layout is Sam planning to use in
    11·1 answer
  • Which option is the default when creating appointments and meetings in a user’s own calendar as it relates to Free/Busy informat
    8·1 answer
  • 8.Which of the following IC was used in third generation of computers?Immersive Reader
    13·1 answer
  • Free coins who is octane and dont say u dont know because i will do the same to u
    13·2 answers
  • ____ can be used to break continuous text to one or more sentences​
    7·1 answer
  • Some operating systems add the command interpreter to the kernel .what will be the justification for this design principle?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!