This assignment is built on top of Assignment 6.Add capability to handle Grade Book for different subjects (Chemistry and Computer Science).We will assume a maximum of five assignments and up to 40 students.Details will be provided in the classFrom Lab 6 You have a Printable interface used by Student.Steps for completing Lab 7 -1. Create a new interface for Faculty to use:package adapter;public interface Createable {public void createGradeBook(String fname);public void printGradeBook();}2. Create a class called InstructorReportpackage model;public class InstructorReport {private Student s[] = null;private Statistics st = null;public InstructorReport(Student [] s, Statistics st){this.s = s;this.st = st}public void print() {//call a method that print all student info.//st.print();}}3. Add methods in Util or FileIO class (Util package) to serialize and deserializeInstructorReport.public void writetodisk(InstructorReport a1, String fname){try {FileOutputStream p = new FileOutputStream(fname);ObjectOutputStream p1 = new ObjectOutputStream(p);p1.writeObject(a1);}catch(Exception e){//exception message}}public InstructorReport readfromdisk(String fname){InstructorReport a= null;try {FileInputStream p = new FileInputStream(fname);ObjectInputStream p1 = new ObjectInputStream(p);a = (InstructorReport)p1.readObject();}catch(Exception e){//exception message}return a;}4. Rename your Print class to CreatePrint.package adapter;public abstract class CreatePrint {private Util u = new Util();private Student arr[] = new Student[40];private Statistics s = new Statistics();private StudentReport arr2[] = new StudentReport[40];public void createGradeBook(String fname) {//This method must be called first before printGradeBook() or getStats() or printStudentScores()//we will call existing methods to://a. read the file and build a student array call readFile in Util//b. compute statistics. call methods in Statistics//c. build StudentReport array [done in lab 6]//d. serialize studentreport upto 40 files. [done in lab 6]//e. For instructor write one file (serialized) with Student [] and Statistics[]}public void printGradeBook() { }//use debug flag for printing. if debug = true then print other no printing.public void getStats() {//print stats from any object read one object from disk and print stats.}public void printstudentscores(int id) {//use the serialized life so your life is easy.//pl. dont use search in studentreport array. long way. no good.}}5. Create a class called GradeBook that extends the abstract class called CreatePrintpackage adapter;public class GradeBook extends CreatePrint implements Creatable, Printable {}//default package.6. Testing your codepublic class Driver7 {public static void main(String [] args){//Test Instructor interfaceCreatable p = new GradeBook();String fname = c:path to filename;p.createGradeBook(fname);p.printGradeBook();//next three lines should give a compiler error can you say why?//p.getStats();//p.printstudentscores(1234);//p.printstudentscores(9111); //invalid student id shld print a friendlymessage no such student.//Test Student InterfacePrintable s = p;s.getStats();s.printstudentscores(1234);s.printstudentscores(9111); //invalid student id shld print a f}}Extra credit information:1. If Lab6 submitted by March 12th midnight you attempt any ec assignment you can earn fullpoints.2. If Lab6 submitted by March 15th midnight you attempt any ec assignment you can 50% of earnedpoints.EC1 Lab 8 [25 points] You design, develop and test.Using Lab 7 add capability for student (add to Printable interface) to compute and print grade.If total score is 91 Print A-Pl. use the following rubric.For Letter Grade:Grade: A+ assigned with 97% or higherGrade: A assigned with 93% or higherGrade: A- assigned with 90% or higherGrade: B+ assigned with 87% or higherGrade: B assigned with 83% or higherGrade: B- assigned with 80% or higherGrade: C+ assigned with 77% or higherGrade: C assigned with 73% or higherGrade: D+ assigned with 70% or higherGrade: D assigned with 63% or higherGrade: D- assigned with 60% or higherGrade: F assigned with 0% or higherEC2 Lab 7 if submitted by 3/19 midnight PST (+2 hours) extra 10 points.EC3 Still thinking.DEBUG flag //Just an example of how to implement DEBUG flagpublic interface GBCons {public final boolean DEBUG = true;}public class Someclass implements GBCons {public void printstats() {//lets say u write code to deserialize a fileStudentReport r = ..;if(r!=null)if(DEBUG)r.getStats.print();
Java Programming
[Solved] This assignment is built on top of Assignment 6
$25
File Name: This_assignment_is_built_on_top_of_Assignment_6.zip
File Size: 442.74 KB
Only logged in customers who have purchased this product may leave a review.
Reviews
There are no reviews yet.