subject

In the written Hawaiian language, only 13 letters are used: the five vowels (a, e,i, o, and u), and 8 consonants (h, k,l, m,n, p,w, and ` (this backwards apostrophe is called an `okina, and is considered a consonant)). (Unfortunately, there is no easy way to write the kahako in ascii text). For this problem you should write two functions, int is_vowel(char); and int is_h_consonant(char); which are each given a character and return True or False. The function is_vowel() returns True is the character is a vowel (upper or lower case), and is_h_consonant() returns True if the character is a consonant (upper or lower case) in written Hawaiian.

You should write a simple (throw away) test driver to test your functions. Be sure you prompt the user (grader) of your test driver on what they should do to test your program. You should write this program in two files; driver1.c containing your test driver, and letters. c containing your functions. You should also have a file, letters. h, containing the prototypes and macros used in letters. c. I have provided a makefile for you in ~ee160/Homework/Hw3 which you can copy to your Hw3 directory. To compile this program, use the command:

make driver1
THIS IS WHAT I HAVE SO FAR:

LETTERS. C

#include"letters. h"

int is_vowel(char c){
return c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U' || c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}

int is_h_consonant(char c){
return c == 'H' || c == 'h' || c == 'K' || c == 'k' || c == 'L' || c == 'l' || c == 'M' || c == 'm' || c == 'N' || c == 'n' || c == 'P' || c == 'p' || c == 'W' || c == 'w';
}

LETTERS. H

int is_vowel(char);
int is_h_consonant(char);

DRIVER1.C

#include
#include"letters. h"

int main()
{
while(1)
{
int input;
//Asks the user to enter 1 or 2 to see if the letter is a consonant
//of vowel.
printf("Enter 1 to check vowel or 2 for consonant:");
//scans inputted number
scanf("%i", &input);
//if the input is 1 then it will ask the user to enter the letter
//they want to test.
if(input == 1)
{
char c;
printf("Enter a character to test if it's a vowel:");
c = getchar();
//if it is a vowel, then it will print that the letter is a vowel
if(is_vowel(c))
{
printf("%c is a vowel.\n", c);
}
//if not, then it will print that it isn't a vowel
else
{
printf("%c is not a vowel.\n", c);
}
}
{
//if the user inputs 2, then it will ask the user for the letter to test if
//it's a consonant or not.

if(input == 2)
{
char c;
printf("Enter a character to test if it's a consonant:");
c = getchar();
//if it is a consonant, then it will print that the letter is a consonant
if(is_h_consonant(c))
{
printf("%c is a consonant.\n", c);
}
//if not, then it will tell the user that it isn't a consonant
else{
printf("%c is not a consonant.\n", c);
}
}
else{
break;
}
}
}

return 0;
}

THIS IS WHAT I GET AS A SAMPLE OUTPUT:

Enter 1 to check vowel or 2 for consonant:2
Enter a character to test if it's a consonant:
is not a consonant.
Enter 1 to check vowel or 2 for consonant:1
Enter a character to test if it's a vowel:
is not a vowel.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:40
Nims is applicable to all stakeholders with incident related responsibilities. true or false
Answers: 1
question
Computers and Technology, 22.06.2019 22:00
Discuss the ways in which electronic information associated with payments is addressed in terms of security. include encryption, secure sockets layers, and secure electronic transactions in your discussion. are there any other ways that consumers and businesses can keep their payment information secure in an electronic commerce environment? do you feel that your information is safe when conducting electronic business? why or why not?
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
Now, open this passage to read about fafsa requirements. describe the information you will need to provide in order to complete a fafsa. list at least three of the required documents you must include.
Answers: 3
question
Computers and Technology, 23.06.2019 22:30
Jamie has to enter the names, employee id’s, and income of a group of employees into a worksheet. which option will jamie use to describe the data
Answers: 3
You know the right answer?
In the written Hawaiian language, only 13 letters are used: the five vowels (a, e,i, o, and u), and...
Questions
question
Mathematics, 29.05.2020 12:57
question
Engineering, 29.05.2020 12:57
question
Mathematics, 29.05.2020 12:57
question
Mathematics, 29.05.2020 12:57
question
Mathematics, 29.05.2020 12:57
Questions on the website: 13722362