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
LenaWriter [7]
3 years ago
9

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

aning 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. You should think about your algorithm before beginning to code this function, and you might want to look at the program wds.c from lecture (and on wiliki in ~ee160/Code.lect/Chars/wds.c) for guidance. (That file is similar, but better, than the code in Chapter 4). The general algorithm for your program will be similar to the word counting program, but the details will vary. Implement your algorithm in the file spchk.c and use the functions in letters.c to test for the appropriate letters. (Hint: You might want to write another function similar to delimitp() used in wds.c, but your code will be different from the delimitp() in the text. You can put any additional functions and/or macros you use in your letters.c and letters.h files).
Computers and Technology
1 answer:
Naya [18.7K]3 years ago
5 0

Answer:

see explaination

Explanation:

#include<stdio.h>

#include <conio.h>

#include <ctype.h>

bool ishawaiian(char,int *);

int main()

{bool legal=true;

char ch;

intlast_ch=0,i;

char inword[20];

int kt=0,voc,done;

while((ch = getchar()) != EOF)

{inword[kt++]=ch;

if(ishawaiian(ch,&voc))

{if(voc==1)

if(kt!=1)

if(last_ch==1)

legal=false;

last_ch=voc;

}

else

{if(voc=3&&!(isspace(ch)||ispunct(ch)))

{legal=false;

done=0;

while(done==0)

{ch = getchar();

if(!(isspace(ch)||ispunct(ch)))

inword[kt++]=ch;

else

{done=1;

kt++;

}

}

}

kt--;

printf("\n");

for(i=0;i<kt;i++)

printf("%c",inword[i]);

if(legal)

printf(": it isvalid\n");

else

printf(": it isinvalid\n");

legal=true;

kt=0;

}

}

getch();

return 0;

}

bool ishawaiian(charch,int* voc)

{charletter[13]={'a','e','i','o','u','h','k','l','m','n','p','w','\''};

int i;

for(i=0;i<13;i++)

{if(ch==letter[i])

{if(i<5)

*voc=0;

else

*voc=1;

returntrue;

}

}

*voc=3;

return false;

}

You might be interested in
I need help look at pic
S_A_V [24]

Answer:

ok

Explanation:

where is the pic that u want us to have a look at

8 0
3 years ago
Why should you pay attention to footprints in deserts and on sand dunes?
Yuliya22 [10]
You should pay attention to footprints in deserts and on sand dunes in case you get lost.
8 0
4 years ago
Custom parameters 1, 2 and 3 provide the same end value for all keywords. true or false?
lesya [120]
Is a Microsoft Bing ads certification Exam question.
I think that the correct answer is:
False

Source and more info: <span>https://goo.gl/JUw7Bw</span>
3 0
3 years ago
What does Al stand for?
prohojiy [21]
AI stands for Artificial Intelligence
5 0
3 years ago
Why might the government give a drug company a patent
castortr0y [4]
Because it is non-illegal and is all natural
5 0
3 years ago
Read 2 more answers
Other questions:
  • Create an application for a library and name it FineForOverdueBooks. TheMain() method asks the user to input the number of books
    9·1 answer
  • find all breweries that specialize in a particular beer style. A brewer is considered specialized if they produce at least 10 be
    5·1 answer
  • Suppose the length of each packet is L bits. Also, assume the path from a server to a client includes N links each of rate R (i.
    8·1 answer
  • The secure evidence locker is located at the ____.
    11·1 answer
  • A screen saver is best described as a
    10·1 answer
  • A user complains that her computer is performing slowly. She tells you the problem started about a week ago when new database so
    12·1 answer
  • Write a method equals that could be added to the IntTree class. (On your handout this method is called "equals", but Practice-It
    10·1 answer
  • It is a science fiction but the answer is not science fiction.it States ;it's inventiveness,uncertainly and futuristic ideas typ
    9·1 answer
  • Problem 4 (25 points)Consider a byte addressing architecture with 64-bit memory addresses.(a)Which bits of the address would be
    5·1 answer
  • Need to know? Anyone feel like helping me not fail
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!