1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vanyuwa [196]
3 years ago
10

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, a

nd ` (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.

Computers and Technology
1 answer:
Sergeu [11.5K]3 years ago
4 0

Answer:

see explaination

Explanation:

Code below:

#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:");

scanf(" %c",&c);

//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.

else if(input == 2)

{

char c;

printf("Enter a character to test if it's a consonant:");

scanf(" %c",&c);

//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;

}

See attachment for sample output

You might be interested in
If you don’t have a paper copy of the FAFSA form, how else can you fill it out?
Ronch [10]
Go on your school computer, and find a copy of the form. Then print it from the school printer.
3 0
2 years ago
Read 2 more answers
If you want to distribute a formatted Microsoft word document to people who don't have word save it as a __file
Helga [31]
If you want them only to read it and not change it send as a .pdf else I would send as a .txt file. Hope that helps
5 0
3 years ago
The first step to keeping your home safe is to minimize the overall amount of _______________ materials you store in your home.
Bingel [31]

Answer: The valuable, precious, or expensive items.

Explanation:

4 0
2 years ago
What is the organizational management practices on planning during a pandemic like corona virus.
eduard

Answer:

wear a mask use hand sanitizer dont get in contact with anyone between 6 feet

Explanation:

3 0
3 years ago
Video Fundamentals
Tresset [83]

Answer:

1) a link, original, a pointer.

2) The media browser can help you by providing the very quick accessibility to all of your assets like iTunes songs, your movies in the movie folder, and this makes your file browsing experience simple while you edit the files.

You can leave the browser open as well as docked quite in the same manner as the other panel.

3) You need to display the Voice-over Record button. Now select your track in the timeline where you want to add the voice-over.

Now you need to go to the Timeline, and click on the Settings button, and finally select the Customize Audio Header.

Now you will see the Button Editor dialog box appearing, and now you need to drag and drop the microphone button to the required audio track, and finally, you need to click on OK.

4) While you are importing the audio or video to the Premiere Pro, it computes versions of such files, which it can readily use for quicker performance. And these are being termed as the Media cache files. And they are being saved in the Media cache files folder.

Explanation:

Please check the answer.

6 0
3 years ago
Other questions:
  • What is the definition of a WAP?
    6·2 answers
  • Whats the best apex legend?
    5·2 answers
  • Which statement about images is correct? A) A virtual image cannot be formed on a screen. B) A virtual image cannot be viewed by
    12·1 answer
  • Show the stack with all activation record instances, including static and dynamic chains, when execution reaches position 1 in t
    6·1 answer
  • Rule number one for handling an emergency is to _____. A. buy a new vehicle B. call law enforcement C. remain calm D. restart th
    6·2 answers
  • Examples of analog computer
    8·1 answer
  • Create an application named SalesTransactionDemo that declares several SalesTransaction objects and displays their values and th
    12·1 answer
  • What is the full form of MOS<br>​
    10·1 answer
  • When did time begin?
    11·1 answer
  • 3. It is important to make certain that your employees are aware of the work ethic
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!