Backend practise. Given 4 input files, generate a text file containing the “report card” of all students in the database. Throw an exception if a student has not completed the course when calculating his/her grade. Junit test protected.
This file contains the courses that a student takes. Each course has a unique id, a name, and a teacher. This file contains all existing students in the database. Each student has a unique id, and a name. This file contains all the tests for each course in the courses.csv file. The file has three columns:● id: the test’s unique id
● course_id: the course id that this test belongs to
● weight: how much of the student’s final grade the test is worth. For example, if a test is worth 50, that means that this test is worth 50% of the final grade for this course.
The sum of all the weights of all tests in a particular course should add up to 100. You are allowed to throw errors in your report card generation script if this is not the case. This file contains all the mark the student received for all the tests that they have written.
The file has three columns:
● test_id: the test’s id
● student_id: the student’s id
● mark: The percentage grade the student received for the test (out of 100)
Note: Not all students are enrolled in all courses – this can be determined by the marks that they receive. All students should have completed (taken every test for) each course they are enrolled in. If a student takes no test in a course, then this student is not enrolled in that course. If there are students that have not completed a course, you can throw an error in your report card generation script.
The output is generated in the output.txt file. Here is an expample of report card:● The first line should contain the student id and the student’s name
● The second line is the average of all the courses the student is enrolled in
● Below that, a listing of all courses and the student’s grade in each course (this
will be determined by the mark they get in each test, and how much each test is
worth)
● The courses are ordered by course id