MindTap - Cengage Learning - Microsoft Edge A https://ng.cengage.com/static/nb/ui/evo/index.html?deploymentld=57811235846758605217306036&elSBN=9781337274715&id=710937855&snapshotld=1589550& >> CENGAGE MINDTAP Q Search this course Programming Exercise 6-2 Tasks main.cpp >_ Terminal 1 //Declare include-header files || (ch == 'a') || (ch =='e') || (ch == 'i') || (ch == 'o') || (ch == 'u')) { マー Successful output using isVowel 2 #include function 3 #include A-Z 0.00 out of 10.00 main.cpp:11:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] main.cpp:11:61: warning: comparison wit h string literal results in unspecified behavior [-Waddress] ) || (ch == 'I') || (ch == "0") || (ch == "U") || (ch == 'a') || (ch =='e') | | (ch == 'i') || (ch == 'o') || (ch 'u')) { 5 //Declare namespace statements 6 using namespace std; O out of 8 checks passed. Review the results below for more details. //Define the isVowel userdefined value-returning function 9. int isvowel(char ch) Checks 10 { if ((ch "0") || 'i') || (ch == 'o') 11 'A') || (ch "E") || (ch == 'I') || (ch == main.cpp:11:61: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] main.cpp:11:76: warning: comparison wit h string literal results in unspecified behavior [-Waddress] ) || (ch == "0") || (ch == "U") || (ch == 'a') || (ch =='e') || (ch == 'i') | | (ch == 'o') || (ch == 'u')) { Test Case • Incomplete (ch "U") || (ch == 'a') || (ch =='e') || (ch == Tests for isVowel output (E) || (ch 'u')) { 12 return true; Code Pattern • Incomplete 13 } banga Checks for isVowel use else 14 15 { Test Case ● Incomplete return false; 16 main.cpp:11:76: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] main.cpp: At global scope: main.cpp:19:1: еггог: ехреcted declaгat ion before '}' token 17 } Tests for isvowel output (a) 18 } 19 } Test Case • Incomplete <> 20 Tests for isvowel output (G) 21 int main() //Define the main function 22 { Test Case • Incomplete <> /bin/bash: line 4: ./a.out: No such fil е ог directoгу 23 //Define variables Tests for isvowel output (p) 24 char character; 25. Run Checks Submit 0% 9:24 PM P Type here to search My Questions | bart. MindTap - Cengag. ProgrammingExerc. 4/12/2020
Can someone help me to fix my user-defined, value-returning expression?
Here's the instructions to my C++
Instructions
Write a value-returning function,
isVowel, that returns the value
true if a given character is a vowel
and otherwise 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.
And here's what I have so far:
//Declare include-header files
#include <iostream>
#include <string.h>
//Declare namespace statements
using namespace std;
//Define the isVowel userdefined value-returning function
int isVowel(char ch)
{
if ((ch == 'A') || (ch == "E") || (ch == 'I') || (ch == "O") || (ch == "U") || (ch == 'a') || (ch =='e') || (ch == 'i') || (ch == 'o') || (ch == 'u')) {
return true;
}
else
{
return false;
}
}
}
int main() //Define the main function
{
//Define variables
char character;
//Testing the isVowel function.
//Prompt the user to input a consonant or a vowel.
cout << "Enter a character that is either a consonant or a vowel: ";
//read the inputted character
cin >> charcter;
endl;
//Output whether the character inputted a vowel or a consonant.If it's a vowel, the program outputs a "1." If the character is a consonant, the program will output a "0."
cout << character <<" is a vowel: " << isVowel(charcter);
return 0;
}
From what I get from my lab environment (as I suspected), I have a problem with my isVowel function. I could use help rewriting my user-defind function so my main program will produce the correct output. Thanks!
![MindTap - Cengage Learning - Microsoft Edge
A https://ng.cengage.com/static/nb/ui/evo/index.html?deploymentld=57811235846758605217306036&elSBN=9781337274715&id=710937855&snapshotld=1589550&
>>
CENGAGE MINDTAP
Q Search this course
Programming Exercise 6-2
Tasks
main.cpp
>_ Terminal
1 //Declare include-header files
|| (ch == 'a') || (ch =='e') || (ch ==
'i') || (ch == 'o') || (ch == 'u')) {
マー
Successful output using isVowel
2 #include <iostream>
function
3 #include <string.h>
A-Z
0.00
out of
10.00
main.cpp:11:31: error: ISO C++ forbids
comparison between pointer and integer
[-fpermissive]
main.cpp:11:61: warning: comparison wit
h string literal results in unspecified
behavior [-Waddress]
) || (ch == 'I') || (ch == "0") || (ch
== "U") || (ch == 'a') || (ch =='e') |
| (ch == 'i') || (ch == 'o') || (ch
'u')) {
5 //Declare namespace statements
6 using namespace std;
O out of 8 checks passed. Review
the results below for more details.
//Define the isVowel userdefined value-returning function
9.
int isvowel(char ch)
Checks
10
{
if ((ch
"0") ||
'i') || (ch == 'o')
11
'A') || (ch
"E") || (ch ==
'I') || (ch ==
main.cpp:11:61: error: ISO C++ forbids
comparison between pointer and integer
[-fpermissive]
main.cpp:11:76: warning: comparison wit
h string literal results in unspecified
behavior [-Waddress]
) || (ch == "0") || (ch == "U") || (ch
== 'a') || (ch =='e') || (ch == 'i') |
| (ch == 'o') || (ch == 'u')) {
Test Case • Incomplete
(ch
"U") || (ch == 'a') || (ch =='e') || (ch ==
Tests for isVowel output (E)
|| (ch
'u')) {
12
return true;
Code Pattern • Incomplete
13
}
banga
Checks for isVowel use
else
14
15
{
Test Case ● Incomplete
return false;
16
main.cpp:11:76: error: ISO C++ forbids
comparison between pointer and integer
[-fpermissive]
main.cpp: At global scope:
main.cpp:19:1: еггог: ехреcted declaгat
ion before '}' token
17
}
Tests for isvowel output (a)
18
}
19 }
Test Case • Incomplete
<>
20
Tests for isvowel output (G)
21 int main() //Define the main function
22 {
Test Case • Incomplete
<>
/bin/bash: line 4: ./a.out: No such fil
е ог directoгу
23
//Define variables
Tests for isvowel output (p)
24
char character;
25.
Run Checks
Submit 0%
9:24 PM
P Type here to search
My Questions | bart.
MindTap - Cengag.
ProgrammingExerc.
4/12/2020](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F16a3305c-3252-417c-ae36-faaf5fb5312f%2Ff09a2af6-16fa-4763-a143-7ae4c727c341%2Fuf7ymbr.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 5 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)