Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Objective: File Input output and flow of control. USING ARRAYS is not allowed for this assignment. Description: The program should first input the number of
Objective: File Input output and flow of control. USING ARRAYS is not allowed for this assignment. Description: The program should first input the number of scores (that will be a fixed number for all students). Your program should also input the name of the file containing the scores of students. The sample input file of student scores looks like this: 15 51 55 50 52 25 80 -1 70 -1 23 53 -1 57 40 21 50 -1 49 50 Each line represents one student. The first column is the student ID and the remaining columns are scores made by the student. Two example files-studenti.txt" and "student2.txt" are given on BlackBoard along with this question. -1 represents an excused score. Your program should read the scores of each student and compute the average score for each student and output the grade of S(satisfactory) or U(unsatisfactory) or l(incomplete). 1 represents an excused score. If a student has 2 or more excused absences, then do not compute the average and give the student a letter grade of I. If the student has less than 2 excused absences then compute the average and determine the grade. Of course, for a student with 1 excused absence the average should not count the-1 score. For example, if the input scores for a student were 53 1, 49 and 50, your program would ignore the -1, since this is the student's only absence. For this student average will be (53+49-50)/3. The letter grade of S should be assigned if the student's average is 50.0 or above and letter grade U if it is below 50.0. At the end of the program the program should print out a summary of how many students made S U and 1. NOTE: YOUR PROGRAM SHOULD be designed to WORK FOR ANY NUMBER OF STUDENTS IN THE FILE. Input: the input user should enter the name of the file and the number of semester. for the given Below is a sample 1/0. Only the bolded words are the inputs provided by the user. Enter the name of the file that has the scores of students: student1 Enter the number of scores for each student: 4 Output: the progra .txt m should write student ID and grade to an output file. The program should also t summary of how many students made S, U and I to the output file. You can use printf method to format the decimal numbers. Let's say if the input file of student scores looks like this: 15 51 55 50 52 25 80 -1 70 -1 23 53 -1 57 40 21 50 -1 49 50 The output file should look like this ID-15 ID=25 Avg-5 Excused-2 2.00 Grade s Grade
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started