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
4.(L.5.1.A) Select the sentence that includes an interjection,
spin [16.1K]

Answer:

Hurray, we won the tournament!

Explanation:

hurray is an interjection just like yikes, uh-oh, and others

5 0
3 years ago
Consider a three sequentially stepped process named as Process A, Process B and Process C. Input comes into Process A. Output fo
Novay_Z [31]

Answer: The process B is at the maximum steady state. A process is said to be at steady state if the variables that define the behavior of the system are unchanging

Explanation: From the Above

Process A takes 2 minutes per unit and hence can process (60/2) = 30 units per hour. Process B can process only (60/3) = 20 units per hour. Process C can handle (60/1) = 60 units per hour. the steady state output from this system is the smallest of the three, that is process B 20 units per hour

4 0
4 years ago
Write a program (C++) that reads a number between 1,000 and999,999 from the user where the user enters a comma in the input.Then
mr Goodwill [35]

<u>C++ program to print the digit without a comma </u>

#include<iostream>

#include<string>

using namespace std;

void commaremoval(string num)  /*Defining function commaremoval with parameter num of string type*/

{  

string  s=num;

for(int i=0; i< s.length();i++)

   {

    if(s[i]!=',') /*Checking whether the string doesn't contain ' ,' */

       cout<<s[i];  //Printing Output without comma

   }  

}

//driver function

int main()

{

string num;

cout<<"Enter a digit between 1,000 and 999,999:"<<endl; /*taking input from user*/

cin>>num;

commaremoval(num); //calling function

return 0;

}

<u>Output</u>

Enter a digit between 1,000 and 999,999:  22,343

22343

7 0
3 years ago
Baking Cookies. Sweet Dough Inc. bakes cookies—a popular dessert—based on the quantities ordered by their customers. Three raw m
Daniel [21]

Answer:

answer is E=CD^.6

Explanation:

CD is cookie dough.

E is number of eggs.

by using amount of cookie dough,we can find number of eggs.

8 0
4 years ago
A competitor goes to your public website and discovers that they can get into a directory that you did not know could be reached
Ivan

Answer:

Yes, directory traversal attack.

Explanation:

A website is a collection big web pages hosted on a web server. It contains contents like links and sometimes directory root paths. This a vulnerability attacks an exploit to access the information in a database.

There are two access to a database. One is the authentication process issued for authorised user access and the other is the root access only accessible to the network administrator. It contains paths to directories in the servers.

A directory traversal attack or path attack is done through a web browser by an attacker, who seeks for a weak path link on the public's website and accesses the information in the server.

5 0
3 years ago
Other questions:
  • _ are typically comprised of a mix of _ and _
    11·2 answers
  • The keyboard preferences pane includes a list of keyboard shortcuts.
    8·1 answer
  • Which of the following information is most important to include in a timeline
    14·2 answers
  • You are using a crimper to attach an RJ-45 connector to a Cat 6 UTP cable. Your company requires that all cabling follow the TIA
    14·1 answer
  • Assume the following:
    10·1 answer
  • Sube
    10·2 answers
  • after landing, you are tying down the aircraft when a person approaches and asks: "faa. are you the pilot of this aircraft?" wha
    11·1 answer
  • you are tasked with managing multiple servers. you want to manage them all from one server manager interface so you don't have t
    9·1 answer
  • Data mining requires specialized data analysts to ask ad hoc questions and obtain answers quickly from the system. select one: t
    12·1 answer
  • many police departments coordinate youth-oriented programs as part of their prevention efforts. which of the following is not an
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!