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.
Answer:
Slide panel is the correct answer.
Explanation:
Answer:
The ouput of the given code is :
22
is "Tom's age.
Explanation:
Here in this code the variable user_name and user_age are initialized to "Tom" and 22 respectively as statement is given in the question i.e cout << user_age << " \nis " + user_name << "'s age.";.This line will print the user_age i.e 22 after that the control moves to the next line and print is "Tom's age.
Following are the code in c++
#include <iostream> // header file
#include <string>
using namespace std;
int main() // main function
{
string user_name="Tom";
int user_age= 22;
cout << user_age << " \nis " + user_name << "'s age.";
return 0;
}
Output:
22
is "Tom's age.
Answer:
Los humanos interactúan con las computadoras a través de una interfaz de usuario
Answer:
its called whats poppin lol
Explanation:
:)