CSE 1320 Assignment 2 solved

$30.00

Category: Tags: , , , , You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (5 votes)

1. (20%) Create a program that calculates the minimum, maximum, median, and mean of a stream of numbers. (a) The program should continue to read values until invalid floating point input is read. (b) You must calculate the minimum, maximum, median, and mean using your own code (NO LIBRARIES). (c) You can use float.h for floating point limits. (d) Use proper indentation and formatting in your code. (e) Arrays and pointers CANNOT be used. (f) Output the values as comma separated values in the following order: i. min ii. max iii. median iv. mean (g) Save your code as stats.c. 2. (20%) Create a program that calculates ALL factors of a given integer. (a) Each factor should be printed on a new line with a fixed width of 10 spaces. (b) The input control string MUST be “Enter an integer: “. (c) If the input happens to be prime, print an additional line with the control string “%d is prime!\n”. (d) Save your code as factors.c. 3. (20%) Write a program that reads a stream of characters and reports the breakdown of vowels within the stream. (a) Vowels should be reported on a new line (see example output). (b) If a vowel is not detected, do not include a line for it. (c) Read characters using getchar(). (d) You CANNOT use arrays or pointers for this assignment. (e) Save your code as vowels.c. CSE 1320: Assignment 2 Dillhoff Example Output > test E: 1 1 vowel detected. 4. (20%) Adapt your previous code sphere_formulas.c such that is keeps the user within the program until an exit choice is entered. (a) Include a conditional branch for when the user presses q or Q to quit. (b) The program should still report if an invalid selection was entered. (c) The program should only exit if the user enters the quit option. (d) Save your code as sphere_formulas.c. 5. (20%) Create a program that compares two strings. The comparison operation should be written as a standalone function. (a) The comparison function must be declared as int strcmp_(char[], char[]). (b) If the strings are equal, the function should return 0. (c) If the strings are equal, but the cases do not strictly match, return 1. (d) If the strings are not equal, return 2. (e) Include a function comment header that explains the return values. (f) The maximum string length is 100. (g) Save your code as compare.c. Create a zip file using the name template _.zip which includes the all required code and answer files. Submit the zip file through Canvas. 2