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
Does learning swift is hard? more than android?
ladessa [460]
No it is not. it's quite simple when you get the hang of it
4 0
3 years ago
A Uniform Resource Locator (URL) consists of three separate parts: network protocol, host, and web browser.
FrozenT [24]
That is false. are you doing it on a computer course.                                             <span />
3 0
3 years ago
Read 2 more answers
Write a program to display MPH (Miles per Hour). Create a function to calculate the MPH. Ask the user for the number of miles dr
puteri [66]

Answer:

In Python:

def MPH(miles,minutes):

   mph = round(60 * miles/minutes,1)

   return mph

   

miles = float(input("Miles: "))

minutes = float(input("Minutes: "))

if miles>0 and minutes>0:

   print("MPH: ",MPH(miles,minutes))

else:

   print("Positive inputs only")

Explanation:

This defines the function

def MPH(miles,minutes):

This calculates mph rounded to 1 decimal place

   mph = round(60 * miles/minutes,1)

This returns the calculated mph

   return mph

The main begins here

This gets input for miles    

miles = float(input("Miles: "))

This gets input for minutes

minutes = float(input("Minutes: "))

If miles and minutes are positive

if miles>0 and minutes>0:

This calls the MPH function

   print("MPH: ",MPH(miles,minutes))

If otherwise, this prompts the user for positive inputs

<em>else:</em>

<em>    print("Positive inputs only")</em>

7 0
2 years ago
Word processing software allows users to do which of the following: format text design pages share documents mail merge document
Sergio039 [100]
Well most word processing softwares allow you to do many things to a document, if you use google documents or microsoft word i'm pretty sure you can do all of those things
5 0
3 years ago
Read 2 more answers
The production team for a fictional drama is shooting a key scene. One of the actors leaves out part of his scripted dialogue th
denis-greek [22]

Answer:

at last sentence was . The editor's work .

8 0
3 years ago
Read 2 more answers
Other questions:
  • Write a loop to print 10 to 90 inclusive (this means it should include both the 10 and 90), 10 per line.​
    6·1 answer
  • This toolbar has icons representing the application's basic operations such as Save and Copy. Drawing Formatting Standard Task
    11·2 answers
  • Which of the following are the rows or columns of white space created between grids?
    7·1 answer
  • With the ease of the Internet, it is not uncommon for individuals to copy skills from resume templates to make themselves look m
    9·1 answer
  • You will be creating a quiz grading program. You will compare the student's answers with the correct answers, and determine if t
    15·1 answer
  • How do you think computers have helped improve documentation, support and services within the healthcare industry
    13·1 answer
  • In order to detect repeated lines anywhere in the input, myuniq must keep track of all of the lines it has seen as it moves thro
    9·1 answer
  • True or False? You should never move an injured person.<br> True<br> False
    6·1 answer
  • How many voltage values can be represented with a 10-bit binary code?
    15·1 answer
  • There are many potential risks associated with the internet. what do we call the distribution and access of illegal copies of di
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!