Design the following functions and call them in main int


Design the following functions and call them in Main

1) int get_student_data(void): This function asks the user to enter the student ID, Quiz, Test, Recitation, Final scores etc and prints them in a file "Stu_score.txt". This function returns the number of students in the class.

2) float curv_factor(int num): num here is meant to be for the number of students in the class. This function opens the "Stu_score.txt" file and determines a curving factor for the class: if the class average of student total scores is less than 70 then the crying factor is 70/mean_class_total score, otherwise curving factor is 1.0; This function returns the curving_factor for the class.

3) char grade(float Q, float T, float curving): This function needs to be given the Quiz, Test, and also the curving factor. It calculates the grade as per our earlier logic and returns the letter Grade (A, B, C, D, or F). A: 90-100, B=80-89, C=70-79, D=60-69, F otherwise.

Main will have the following steps:

1) call int get_student_data(void)

2) call float curv_factor(int num)

3) Print on screen the value of curving factor as shown below.

4) Open the "Stu_scpore.txt" and using a for loop scan the data, and repeatedly call char grade (float Q, float T, float curving)in order to print the ID and Grades of each student in the class on the screen.

Your CODE uses three functions in the following manner:

(a) void random_gen (void): This function,

(1) Asks user input for lower and upper limits for random numbers, and Scans them.

(2) Asks user number "how many numbers to be generated?" and scans it.

(3) Opens file "Rand_num.txt" and writes "those many" random numbers in that file in one column by repeatedly calling function int rand_int (int low, int high), which uses "calendar time" as seed to generate random numbers between (low and high), including low and high.

(b) float Mean_Min_Max (int * min, int*max): This function opens file "Rand_num.txt", scans the numbers repeatedy using a while loop, finds the "largest" , "smallest" numbers in the file, and also calculates an "returns" the average of these numbers. The function uses integer pointers to convey to the main the "largest" and the "smallest" numbers in the file.

(c) The main calls function random_gen() first get user inputs and print numbers in the file. It then calls function Mean_Min_Max(„ ) to find the Mean, Minimum and Maximum in the list and prints this information on screen.

Attachment:- Functions Design Assignment.rar

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Design the following functions and call them in main int
Reference No:- TGS01711845

Expected delivery within 24 Hours