Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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"

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Find the solution (s) of the following equation. k^(2)=225

Answered: 1 week ago

Question

Does it have at least one-inch margins?

Answered: 1 week ago

Question

Does it highlight your accomplishments rather than your duties?

Answered: 1 week ago