I am trying to write a code that will count the parts of an inputted sentence (vowels, alpha, and keystrokes). I am not getting any errors when I debug, but my calculation keeps coming up identical for each category (and wrong) no matter what I input for the sentence. Please help! Thanks so much!
Code://This program is designed read an inputted sentence and count the keystrokes, //alpha characters, and vowels in the sentence and display each count as output. #include <stdio.h> #include <stdlib.h> #include <ctype.h #include <string.h> int main(void) { char sentence[9999]; //Defines the character array for sentence input and analysis. int isdigit(int sentence); //Function returns non-zero if its argument is a digit between 0-9. Otherwise, zero is returned. int counter=0; //Counter variable. int keystrokes=0; //Keystrokes variable. int alpha_characters=0; //Alpha characters variable. int vowels=0; //Vowels variable. printf("Please input you sentence to be analyzed and hit enter to begin program.\n"); //Prompt for user to input sentence. scanf(" %s",sentence); //Keyboard input of sentence. for(counter=0;sentence[counter]!='\n';++counter) //For loop to analyze sentence parts. { if(sentence[counter]=='a'||'A'||'e'||'E'||'i'||'I'||'o'||'O'||'u'||'U') //Analyze lowercase and uppercase vowels in sentence. { ++keystrokes; //Add to keystrokes count. ++alpha_characters; //Add to alpha characters count. ++vowels; //Add to vowels count. } elseif(isdigit(sentence[counter])==1) //Analyze all alpha characters in sentence. { ++keystrokes; //Add to keystrokes count. ++alpha_characters; //Add to alpha characters count. } else//Analyze all keystrokes in sentence. { ++keystrokes; //Add to keystrokes count. } } printf("Stephanie Johansen\tProgram #5\tCS604\n"); //Print header for output. printf("Keystrokes:\t\t %4i\n", keystrokes); //Print total Keystrokes output. printf("Alpha Characters:\t %4i\n", alpha_characters); //Print total Alpha Characters output. printf("Vowels:\t\t\t %4i\n", vowels); //Print total Vowels output. return 0; //Exit program. }