Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CSc 1325 Programming Fundamentals Program 8 Required competencies This project w

ID: 3657868 • Letter: C

Question

CSc 1325 Programming Fundamentals Program 8 Required competencies This project will require students to demonstrate the following skills:  use of characters  use of pointers  use of strings  use of string functions Program Description Write a program that does the following: 1. Read an integer n from the keyboard. 2. Read n strings from the keyboard. 3. For each input string: (a) Print the number of lower case letters in the string (b) Print the number of digits in the string. 4. Create functions to compute the number of lower case characters in the string and to compute the number of digits. These functions return their results, they do not print anything. 5. No single string will be more than 100 characters in length. Optional bonus (40 points): This section is optional. To receive additional points, your program must also meet the following requirements. You will be graded on your ability to anticipate and implement the programming practices that have been used in the course. No help is available for this part of the assignment. Late submissions are not eligible for credit in this part of the assignment. 1. After all other program output, print the word onus" 2. Next, print the number of integers found among the n strings. Do not count integer n itself. Examples: Example 1: $ ./a 1 A 0 0 Example 2: $ ./a 1 a 1 0 Example 3: $ ./a 1 9 0 1 Example 4: $ ./a 3 a7Z7z ABC_xyz 010101 2 2 3 0 0 6 Suggested Strategy Overall strategy: 1. Read integer n 2. Use counter controlled iteration to read n strings. 3. Write a function to count the number of lower case letters in a string. 4. From within your loop, call your lower case character counting function and print the value it returns. 5. Write a function to count the number of digits in a string. 6. From within your loop, call your digit counting function and print the value it returns. Counting functions: 1. For each function (counting lower case characters and counting digits), de ne a function that accepts a single string argument and returns an integer. 2. Create a counter and initialize it to 0. This counter is not used for counter controlled iteration. 3. Iterate over the characters in the argument and check each one to see if it is a character that needs to be counted. If it is, increment the counter. 4. When iteration is nished, return the value of the counter. Other Requirements 1. Check for errors! 2. Run your program. Make sure it works! 3. Place your name and the project name in a comment at the top of your source le.Submission When you are sure your program is working, turn in your source le to Moodle.

Explanation / Answer

#include #include #include #define STRINGSIZE 100 /*Prototypes*/ void getString(char *string); void lowToUpper(char lowerData[]); //convert the string to uppercase void upToLower(char upperData[]); //convert the string to lowercase int numGraph(char *string); //counts # characters /*Main program input*/ int main(int argc, char *argv[]) { char string[STRINGSIZE]; int count; getString(string); printf("Entered string => %s", string); count = numGraph(string); printf("Number of characters in string = %d ", count); lowToUpper(lowerData) upToLower(upperData) system("PAUSE"); return 0; } /*void codes*/ void lowToUpper(char lowerData[]) { for (i=0; i