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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Can someone help me to fix my user-defined, value-returning expression?

Here's the instructions to my C++ Program:

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
Transcribed Image Text: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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education