Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C language This program reads in a series of words. All words consist of only lower-case letters ('a' through 'z'). None of the words

In C language

This program reads in a series of words. All words consist of only lower-case letters ('a' through 'z'). None of the words entered will be longer than 50 letters. The program reads until ctrl-d (end-of-file), and then prints out all the lower-case letters that were missing in the input or a statement indicating the input has all the letters. Two executions of the program are shown below.

Enter your input: the quick brown fox jumps over the lazy old dog Your input contains all the letters 
Enter your input: alabama crimson tide Missing letters: f g h j k p q u v w x y z 

Hints:

  • Use an array of 26 elements to store the number of times you have seen the characters 'a' through 'z'. 'a' is actually an integer of value 97 (its ASCII value). If you subtract 'a' (or 97) from a lower-case letter, you will get a number in the range of 0 to 25.
  • To test this program, it is a good idea to create a file (input1.txt for example) to contain all the input words. Then test the program with input redirection: ./a.out < input1.txt (or ./a.exe < datafile). Make sure the input file ends with a newline.

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

Deductive And Object Oriented Databases Second International Conference Dood 91 Munich Germany December 18 1991 Proceedings Lncs 566

Authors: Claude Delobel ,Michael Kifer ,Yoshifumi Masunaga

1st Edition

3540550151, 978-3540550150

More Books

Students also viewed these Databases questions