Question
Need help on C++ Homework. Thanks I have already completed the assignment below, however my instructor told me Please update code to numeric values associated
Need help on C++ Homework. Thanks
I have already completed the assignment below, however my instructor told me "Please update code to numeric values associated with ASCII and Unicode"
Here is the code below that needs to be fixed on what the instructor said.
#include
using namespace std;
int main(){
char ln[100];
int vowels, consonants, digits, spaces;
vowels = consonants = 0;
cout
cin.getline(ln, 100);
for(int i = 0; ln[i]!='\0'; ++i){
if(ln[i]=='a' || ln[i]=='e' || ln[i]=='i' ||
ln[i]=='o' || ln[i]=='u' || ln[i]=='A' ||
ln[i]=='E' || ln[i]=='I' || ln[i]=='O' ||
ln[i]=='U' || ln[i]=='Y' || ln[i]=='y'){
++vowels;
}
else if((ln[i]>='a'&& ln[i]='A'&& ln[i]
++consonants;
}
}
cout
cout
return 0;
}
Task: Write a program that reads a word and prints the number of vowels and consonants in the word. For this exercise assume 'a', 'e', 'i', 'o', 'u', and 'y' are vowels. Please write a short paragraph, bullet points, or pseudocode describing you algorithm for solving the problem For user input "Harry", the program should print FULL TRAVERSAL 2 vowels and 3 consonants. The user of the program should input the word
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started