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
UNO [17]
3 years ago
12

Instructions Write a value-returning function, isVowel, that returns the value true if a given character is a vowel and otherwis

e returns false. For the input E, your output should look like the following: E is a vowel: 1 When printing the value of a bool, true will be displayed as 1 and false will be displayed as 0.
Computers and Technology
1 answer:
Masja [62]3 years ago
7 0

Answer:

This function returns a Boolean value in the form of Boolean variable which shows whether the parameter is a vowel or not.

return result;

The c++ program for the above is given which shows the output in the given format.

#include <stdio.h>  

#include <iostream>  

using namespace std;

bool isVowel(char c);

bool isVowel(char c)

{

   bool result=false;    

   if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'A' || c =='E' || c =='I' || c =='O' || c =='U')

       result = true;    

   return result;

}  

int main() {

   char data;    

   cout<<"This program will check if the entered character is a vowel."<<endl;

   cout<<"Enter any alphabet"<<endl;

   cin>>data;    

   cout<<endl<<data <<" is a vowel: "<<isVowel(data)<<endl;    

   return 0;

}

OUTPUT

This program will check if the entered character is a vowel.

Enter any alphabet

o

o is a vowel: 1

Explanation:

The function which accepts an alphabet and returns a value is shown below.

bool isVowel(char c)

{

   bool result=false;

   if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'A' || c =='E' || c =='I' || c =='O' || c =='U')

       result = true;

   return result;

}

The function isVowel() accepts an alphabet which is stored in a character variable and returns a Boolean value.

bool isVowel(char c)

This function declares a Boolean variable, result, and initializes it to false.

bool result=false;

The parameter is matched will all the vowels in both lower case and upper case. If the character matches, i.e., if it is a vowel, the Boolean variable is initialized to true. If the alphabet does not matches, there is no change in the value of Boolean variable result, i.e., result holds the value false.

if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'A' || c =='E' || c =='I' || c =='O' || c =='U')

       result = true;

You might be interested in
What is network management?
melamori03 [73]
Network management is  a broad range of  functions including activities, methods, procedures and the  use of  tools to administrate,operate,and  reliably maintain computer network system.  <span />
3 0
4 years ago
This function whose primary purpose is to display information to the user can only display one value at a time.
Leya [2.2K]

Answer:

False

Explanation:

The functions that was made for display content can get  arguments of different type e.g. (Int, string, Array, Objects) and if you want to display n values you only have to check the syntax of your programming language to separate one of each other

# Python example

a = "Hello-"

b = "World"

c = 10

print(a,b,c)

#Out: Hello-World10

I hope it's help you.

4 0
3 years ago
What is segmentation and paging?
iogann1982 [59]

Over the years, operating systems have sought to be more efficient, which is why it is vital that the use of main memory such as ram be as intelligent as possible, so that operating systems are more efficient.

Segmentation is a process of dividing the program into logical units, such as sub functions, arrays, variables, etc., making it possible to have processes divided into pieces so that it is easy to access each of the processes that this leads to its execution. Segmentation allows the programmer to contemplate the memory as if it had several address spaces or segments. References to memory consist of an address of the form segment number - offset.

Pagination is a technique where memory space is divided into physical sections of equal size, called page frames. The programs are divided into logical units, called pages, that are the same size as the page frames. In this way, an information page can be loaded in any page frame. The pages serve as an information storage unit and transfer between main memory and auxiliary or secondary memory. Each frame is identified by the frame address, which is in the physical position of the first word in the page frame.

8 0
3 years ago
Enumerate the the risk in the preparation and cooking in starch and cereal dishes and other food​
Novay_Z [31]
———————————————————.
6 0
3 years ago
Create a program to deteate a program to determine whether a user-specified altitude [meters] is in the troposphere, lower strat
nordsb [41]

Answer:

#include <iostream>

using namespace std;

int main()

{

   float altitude;

   cout<<"Enter alttitude in meter";

cin >>altitude;

if(altitude<0 || altitude > 50000)

{

   cout<<"Invalid value entered";

   return 0;

}

else{

   if(altitude<= 10000)

   {cout <<"In troposphere "<<endl;}

   

   else if(altitude>10000 && altitude<=30000)

   {cout <<"In lower stratosphere"<<endl;}

   

   else if(altitude>30000 && altitude<=50000)

   {cout <<"In upper stratosphere"<<endl;}

   

}

   return 0;

}

Explanation:

Define a float type variable. Ask user to enter altitude in meters. Store value to altitude variable.

Now check if value entered is positive and less than 5000,if its not in the range of 0-50,000 display a termination message and exit else check if it's in less than 10000, in between 10000 and 30000 or in between 30000 and 50000.

10,000 is above sea level is troposphere.

10,000-30,000 is lower stratosphere.

30,000-50,000 is upper stratosphere.

3 0
3 years ago
Other questions:
  • Maggie is preparing a business report. Which types of keys will she use to type out words and numbers?
    6·2 answers
  • What is an input, output and storage device?
    12·1 answer
  • write a function that takes a string as parameter, return true if it’s a valid variable name, false otherwise. You can use keywo
    6·1 answer
  • 1. Print out the string length of s1 2. Loop through characters in s2 with charAt() and display reversed string 3. Compare s2, s
    6·1 answer
  • Kevin manages the security for his company and is working to implement a kernel integrity subsystem for key servers. Of the foll
    9·1 answer
  • 5. Which one of the following statements is true for spell checkers? A. Most spell checkers flag inappropriate word usage. B. A
    5·1 answer
  • A computer (mainframe, server, or workstation) that has an operating system enabling _____________ to access it at the same time
    11·1 answer
  • Write a program that asks the p34won to enter their grade, and then prints GRADE is a fun grade. Your program should repeat thes
    7·1 answer
  • What year did apple computer introduce the first ipod?.
    8·1 answer
  • eocs can be fixed locations, temporary facilities, or virtual structures with staff participating remotely.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!