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
Which of the following is another term for a subfolder​
marin [14]

Answer:

below

Explanation:

subdirectory

5 0
3 years ago
Explain each kind of pointer and for what it is appropriate
ycow [4]

Answer:

Explanation:

A pointer is nothing but a memory location where data is stored. A pointer is used to access the memory location. There are various types of pointers such as a null pointer, wild pointer, void pointer and other types of pointers. ... When you want to deal different variable data type, you can use a typecast void pointer.

8 0
3 years ago
Read 2 more answers
A program that will ring a bell six times is what kind of program?
amm1812

Answer:

D

Explanation:

because it is a sequence it does more than one thing

6 0
3 years ago
Read 2 more answers
Which statement best describes the difference between a spreadsheet and a database?
Dmitrij [34]

Answer:

Databases store data in tables that interact; spreadsheets store data in cells that interact.

Explanation:

3 0
2 years ago
Read 2 more answers
The ______________________ is the part of the ip address that is the same among computers in a network segment.
kozerog [31]
The answer is 
External IP address.
4 0
3 years ago
Other questions:
  • When using the “reply all” option, your message will automatically be sent to ____ recipients of the original message. ​?
    7·2 answers
  • What inventor patented the first american movie projector
    15·2 answers
  • When you move a paragraph in a document that includes text with a footnote, what happens to the footnote reference?
    7·2 answers
  • In this scenario, hackers launch cyber-attacks that affect several parts of the nationâs financial infrastructure over the cours
    8·1 answer
  • Select the correct answer.
    5·2 answers
  • A term to describe articles that can be displayed in their entirety,as opposed to abstract and references only
    11·1 answer
  • (a) List 5 keys we can type with our left hand fingers
    9·1 answer
  • What is the theory of relativity? How does it relate to the creation of electricity through solar energy?
    12·1 answer
  • The success criteria are used to judge whether a project is successful. False True <br> need it now
    13·2 answers
  • Write steps: To open an old documents​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!