x1: Write a program that uses a void function – a function that does not return a value. Call this function “isVowel()”. Take a character input from user, inmain()function, and pass the value to...

1 answer below »

x1: Write a program that uses a void function – a function that does not return a value. Call this function “isVowel()”. Take a character input from user, inmain()function, and pass the value to theisVowel()function.isVowel()function checks if the character is a vowel or not and updates themain()function using a “by Reference” parameter, not by returning a value. Print whether the character entered by the user is a vowel or not, in themain()function.


Ex2: Write a program that uses a function,reverseDigit, that takes an integer as a parameter and returns the number with its digits reversed. For example, the value ofreverseDigit(12345)is54321; the value ofreverseDigit(5600)is65; the value ofreverseDigit(7008)is8007.


Ex3: Modify the program you wrote in Ex2 by making the return type ofreverseDigitfunctionvoidfor the same output. Do not print the result inside thereverseDigitfunction. The functionreverseDigitcan no longer return a value. You will need to use a “by Reference” parameter to update the main function accordingly.


Hint:This is how you can separate digits from an integer: If the number is 2345, you can use the % operator to separate the right most digit by 2345 % 10 which will give you 5. Then divide the num by 10 (decimal) and you will be left with 234. Repeat.

Answered Same DayApr 11, 2021

Answer To: x1: Write a program that uses a void function – a function that does not return a value. Call this...

Aditya answered on Apr 11 2021
142 Votes
#include
using namespace std;
void isVowel(char &c, bool &check)
{
    if (c == 'a' ||
c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'A'|| c == 'E' || c == 'I' || c == 'O' || c == 'U')
    {
        check = true;
    }
}
int main()
{
    bool check = false;
    char c;
    cout << "Enter...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here