Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please use the skeleton key to fit the parameters ort java. io. FileInputStream; ort java. io. IOException; Authors: Fukuda, Zander (edited by Nash, minor edits
please use the skeleton key to fit the parameters
ort java. io. FileInputStream; ort java. io. IOException; Authors: Fukuda, Zander (edited by Nash, minor edits by Lin) lic class Possibleskeleton I/... class constants go here... public static void main(String [] args) \{ int courseNumber; / Number of the course Scanner inputFile = null; // File containing data (p. 297 1) in Savitch discusses null) /I ... code assigning inputFile in a try/catch statement II ... code for any stuff you need to do one time ... //Per class, print a table of ID numbers, grades, weighted average 1/ per student, and a Pass or Fail programs grade. The class II average is also printed. for (...) \{ I/ Read class number, print class number title, headings. courseNumber = inputFile. nextint(); ... rest of the code goes here ... If initialization ... code goes here... 1/ Loop to handle one class: For each student in the class, get and print their If information, compute their avg, and sum the avgs. while () f \}.... code goes here ... public static void main(String[] args) \{ int courseNumber; /I Number of the course Scanner inputFile = null; // File containing data (p,297 // in Savitch discusses null) 1/... code assigning inputFile in a try/catch statement I/ ... code for any stuff you need to do one time ... //Per class, print a table of ID numbers, grades, weighted average 1/ per student, and a Pass or Fail programs grade. The class 11 average is also printed. for (...) \{ I/ Read class number, print class number title, headings. courseNumber = inputFile. nextInt (; ... rest of the code goes here ... 1/ initialization ... code goes here... 1f Loop to handle one class: 11. For each student in the class, get and print their If information, compute their avg, and sum the avgs. while () \{ 3 ... code goes here ... 1/ compute and print class average \} 3.... code goes here ... Feel free to use something different. There are any number of solutions and this skeleton is merely one possible acceptable structure for this assignment. However, make sure whatever solution you use satisfies the possible grading criteria. (For instance, in the above skeleton method calls are left for you to fill in; this does not mean that your program should be one big main method with no other methods.) Your program will read from an input file: courseData.txt . Note that when you click on the link to this file, Canvas will automatically put it into a window in the Canvas environment. You'll need to select the data and copy it to an open text file (such as open with NotePad or Word) and save it as plain text. Do not save it as Rich Text Format (rtf) or a Word format (.doc or doc x ). The above input file has a number of data items stored in the file in the following order: 1. Global data is on the first line, as this applies to all classes. This first line holds the weights to use for all classes, in this order: program weight, midterm weight, and final exam weight. 2. Every other line in the file is specific to a class, and so the next line starts with a course identifier (161, 162, or 263 , and this is an int). 3. After the course identifier, a set of lines belonging to that course are listed, each with a student ID (four digits, such as 1234), an unweighted program score, an unweighted midterm score, and an unweighted final score. You may assume that each course in the file has at least one student. 4. Reaching a 0 indicates the end of input for a specific class, or the end of file if all class data has been consumed. Note that the courseData.txt file terminates with a newline character after the final zero. This means that will test true even after that final zero is read. Given this data file, your program should: 1. Be well-documented with comments! I've included a number of comments in the sample code below as examples. This is the first assignment where you'll be graded on both correctness and code quality, with respect to comments. (Read the grading rubric for a list of everything you'll be graded on!) 2. Read in weights, IDs, course numbers, programs scores, midterm scores, and final scores per student from the sample input file provided (using or 3. Calculate statistics per student and per class and report the following: a. Output a weighted average per student. b. Output a Pass/Fail mark per student. c. Output an average per class. 4. Your output should be compared against the sample output below for accuracy. 5. There should be at least one method that you write that can be used to provide output for tracing variables: a. The method should be called -something, e.g., b. Somewhere in your program, there should be a call to that method. In the code you submit, that call should be commented out, but I should be able to find it. Your assignment is to write a class averaging program that outputs a summary of classes and students, given the above input data. For a high-level view, a sample program execution below is given, with some of the output replaced by ellipses. (The report goes to the console. If this assignment is too easy, for an added challenge, have the report be written in a GUI using JOptionPane.) YOUR PROGRAM'S OUTPUT MUST LOOK LIKE THIS SAMPLE. Minor deviations are permitted, such as the number of spaces between columns, but for the most part, it should look like the sample: Grade Data For Class 162 Grade Data For Class 263 I0 Programs Midterm Final Weighted Average Programs 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