Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In JAVA Please. Objective: File Input output and flow of control. USING ARRAYS is not required for this assignment. Description: The program should first input

In JAVA Please.

Objective: File Input output and flow of control. USING ARRAYS is not required 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 - student1.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 I(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 students 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 I.

NOTE: YOUR PROGRAM SHOULD WORK FOR ANY NUMBER OF STUDENTS IN THE FILE.

Input: the input user should enter the name of the file and the number of scores for the given semester.

Below is a sample I/O. Only the bolded words are the inputs provided by the user.

Enter the name of the file that has the scores of students: student1.txt

Enter the number of scores for each student: 4

Output: the program should write student ID and grade to an output file. The program should also print summary of how many students made S, U and I to the output file.

Lets 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 Avg=52 Grade=S

ID=25 Excused=2 Grade=I

ID=23 Avg=50.0 Grade=S

ID=21 Avg=49.7 Grade=U

Number of Grades of Type

S U I

2 1 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

Students also viewed these Databases questions

Question

=+ What substantive provisions are identified?

Answered: 1 week ago

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago