Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Please advise on how to complete missing code from this class. The missing code indicated below with hints by the comments with //TODO: import

imageimageimage

Please advise on how to complete missing code from this class.

The missing code indicated below with hints by the comments with //TODO:

 

import java.util.ArrayList;

import java.util.*;
import java.io.*;

public class ResultProcessSystem {

//Constant for file name - do not change.
private final static String STUDENTS_DATA_FILE_NAME = "students.csv";
private final static String UNITS_RESULT_DATA_FILE_NAME = "units_result.csv";
private final static String RESULTS_RELEASE__OUTPUT_FILENAME = "results_release.csv";
private final static String UNMATCH_UNITS_RESULT_FILENAME = "unmatch_units_result.csv";

//One ArrayList to store both Coursework and Research Student and
//one Arraylist to store both Unit
//make use of Polymorphism!
private static ArrayList students;
private static ArrayList units;

public static void run() {
 students = new ArrayList();
 units = new ArrayList();
 readInStudentsDataFromCSVFile();
 readInStudentsUnitResultFromCSVFile();
 matchUnitToStudent();
 sortStudentsArrayListByStudentID();
 printStudentArrayListToResultReleaseCSV();
 printUnitsWithNoStudentsMatchToCSV();
}

private static void readInStudentsDataFromCSVFile() {
 
 try {
  Scanner file = new Scanner(new File(STUDENTS_DATA_FILE_NAME ));
  while(file.hasNextLine()) {
   //TODO: convert each record to a student object
   //add student object to ArrayList students
   file.nextLine();
  }
 
 }catch(FileNotFoundException ex) {
  System.out.println("Student data file not found");
 }
}

private static void readInStudentsUnitResultFromCSVFile() {
 try {
  Scanner file = new Scanner(new File(UNITS_RESULT_DATA_FILE_NAME));
  while(file.hasNextLine()) {
   //TODO: convert each record to either a Unit_Coursework
   //or Unit_Research object and add it to ArrayList units.
   file.nextLine();
  }
 
 }catch(FileNotFoundException ex) {
  System.out.println(UNITS_RESULT_DATA_FILE_NAME+" file not found");
 }
}

private static void matchUnitToStudent() {
 //TODO: look for each student object unit results in units ArrayList
 //assign the unit into the student object
 //remove the assigned unit from units ArrayList
}

private static void sortStudentsArrayListByStudentID() {
 //TODO: sort the ArrayList students by Student ID
}

private static void printStudentArrayListToResultReleaseCSV() {
 
 try {
  PrintWriter pw = new PrintWriter(RESULTS_RELEASE__OUTPUT_FILENAME);
  //TODO: print result_release.csv
  pw.close();
 
 }catch(FileNotFoundException ex) {
  System.out.println("Unable to open "+RESULTS_RELEASE__OUTPUT_FILENAME);
 }
}

private static void printUnitsWithNoStudentsMatchToCSV() {
 try {
  PrintWriter pw = new PrintWriter(UNMATCH_UNITS_RESULT_FILENAME);
  //TODO: print unmatch_units_result.csv
  pw.close();
 
 }catch(FileNotFoundException ex) {
  System.out.println("Unable to open "+UNMATCH_UNITS_RESULT_FILENAME);
 }
}

public static String getStudentsDataFileName() {
 return STUDENTS_DATA_FILE_NAME;
}

public static String getUnitsResultDataFileName() {
 return UNITS_RESULT_DATA_FILE_NAME;
}

public static String getResultsReleaseOutputFilename() {
 return RESULTS_RELEASE__OUTPUT_FILENAME;
}

public static String getUnmatchUnitsResultFilename() {
 return UNMATCH_UNITS_RESULT_FILENAME;
}

public static void main(String[] args) {
 run();
}
}

The UoWSIM graduate school offers coursework and research program. Courswork: The coursework student takes one Unit in each term and the assessment components are: Assignment 1 (20%) Assignment 2 (30%) Exam (50%) Each assessment is upon 100 marks. The student will be awarded a grade based on the following: Grade Score HD (High Distinction) D (Distinction) C (Credit) P (Pass) F (Fail) (85%-100%) (75%-84%) (65%-74%) Research: The research student takes one Unit in each term and the assessment components are: Proposal (30%) Final Dissertation (70%) (50%-64%) (0%-49%) Each assessment is upon 100 marks. The student will be awarded a grade based on the following: Grade Score P (Pass) F (Fail) (50%-100%) (0%-49%) students.csv The Result Processing System (RPS) is used to process the student results. RPS will read in students and units result from two csv files: students.csv and units_result.csv. units_result.csv o This file stores the student's information. This file stores the student's unit result. (See appendix for sample students.csv and units_result.csv) RPS will generate two csv files: result_releases.csv and unmatch_units_result.csv. result_releases.csv This file contains the student id and grade for each student. o If the student unit result is not found, it will be reported as either "No unit attempt" or "Research incomplete". unmatch_units_result.csv o Some unit result in units_result.csv cannot be matched to any student id in students.csv. Such unmatched units will be stored in this file. (See appendix for sample result_releases.csv and unmatch_units_result.csv)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

solutions Heres the corrected code for the AdjacencyListGraphjava file import javautilpublic class AdjacencyListGraph extends DirectedGraph protected ArrayList AdjacencyListVertex vertices new ArrayLi... 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_2

Step: 3

blur-text-image_3

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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students explore these related Programming questions

Question

Implement the method contains() for BST.

Answered: 3 weeks ago