Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Written Hawaiian also has fairly simple spelling rules for determining if a word is a valid word in the language (even if the meaning is

Written Hawaiian also has fairly simple spelling rules for determining if a word is a valid word in the language (even if the meaning is unknown). They are:

All words contain only vowels and Hawaiian consonants.

All words end in a vowel.

Within a word, two consonants NEVER appear adjacent.

Write a program which reads lines of Hawaiian text from a file (using redirection, so you will not need to prompt), and lists each word found on a separate line indicating whether it is a valid Hawaiian spelling or it is invalid. Any non-letter characters (e.g. white space or punctuation characters) in the file should be treated as delimiters, but otherwise ignored and not appear in the output.

I have the files to determine if it is a Hawaiian letters, I'm just having trouble with making a function called "delimp()" to rid the program of any whitespace as well as the file to make this all happen "spchk.c".

letters.c

#include "letters.h"

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

return 0; } }

int is_h_consonant(char c) { if ( 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' || c == '`') { return 1; } else{

return 0; } }

letters.h

#define TRUE 1 #define FALSE 0

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

Thank you to whoever takes the time to help me out with this!

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

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions