V22.0002-002 Lab Programming Assignment 2

Due Date:  Week of October 14th

Write C programs to perform the following tasks:

A)   Write a program to read in 10 numbers and compute the average, maximum and minimum values.

B)  Write a program to count the vowels and letters in free text given as standard input. Read text a character at a time until you encounter a <return> with ASCII value of 10.

Then print out the number of occurrences of each of the vowels a, e, i, o and u in the text, the total number of letters, and each of the vowels as an integer percentage of the letter total.  Assume all input to your program is lower case text.  In other words, no need to check for upper case vowels.

Suggested output format is:

        Numbers of characters:
        a   3 ; e   2 ; i   0 ; o   1 ; u   0 ; rest  17
        Percentages of total:
        a  13%; e   8%; i   0%; o   4%; u   0%; rest  73%

Read characters to end of data using a construct such as

            char ch='\0';
            while( ( ch = getchar() ) != 10 )
                        /* ch is the next character */ ....

Read characters one at a time using getchar() until a <return> is entered.


You will need to demonstrate two separate programs to the grader; One for Part A and a second one for Part B.  Total points for this assignment is 10, 5 for part A and 5 for part B.