B. Description The program should include 4 classes & 1 interface: Print.java – Interface for course printing. Course.java – Abstract superclass that stores general course information....




  • B. Description


    The program should include 4 classes & 1 interface:






  • Print.java – Interface for course printing.




  • Course.java – Abstract superclass that stores general course information.




  • GradedCourse.java – Subclass of Course. Stores grade information from courses


    you have already taken. These courses are used to compute your GPA.




  • NonGradedCourse.java - Subclass of Course. Stores schedule information from


    courses you are currently taking and do not have a grade yet. These courses do not


    affect the computation of your GPA.




  • MyDegree.java – Contains the “main” method and the logic of your program.


    B.1 Print Interface


    The Print interface is stored in package catalog and contains:




• A public print method.


B.2 Course Class (Abstract)


Abstract Class Course implements Print interface, it is stored in package catalog and contains:




  • A private String data field institution storing the institution name, e.g. “USF”.




  • A private String data field prefix storing the 3 letter course prefix name.




  • A private String data field number storing the 4 digit course number.




  • A private int data field credits storing the number of credit hours.




1




  • A private String data field name storing the course name.




  • A private String data field semester storing the semester the course was taken.




  • Methods that set and return the values for each variable.




  • A print method printing the values of all variables.


    B.3 GradedCourse Class


    Class GradedCourse is a subclass of Course. It is stored in package catalog and contains:






  • A private String data field named letterGrade storing the letter grade (include -/+).




  • A private double data field named numericalGrade storing the numerical grade


    corresponding to the letter grade.




  • Methods that set and return the values for each variable.




  • A print method printing the values of all variables.


    B.4 NonGradedCourse Class


    Class NonGradedCourse is a subclass of Course. It is stored in package catalog and contains:






  • A private String data field days storing the days the class is taught, e.g. “TuTh”.




  • A private String data field startTime storing the time class starts, e.g. “12:30pm”.




  • A private String data field endTime storing the time class ends, e.g. “1:45pm”.




  • A private String data field bldgName storing the name of the building where the


    class is taught, e.g. “SOC”.




  • A private String data field roomNumber storing the number of the room where the


    class is taught, e.g. “151”.




  • A private String data field named instructorName storing the name of the


    instructor teaching the class, e.g. “Weitzenfeld”.




  • Methods that set and return the values for each variable.




  • A print method printing the values of all variables.


    B.5 MyDegree Class


    Class MyDegree is stored in package degree and contains:






  • The main method, from which the init and print methods get called.




  • An init method that reads ALL your course information from a text file. Use


    exception handling when reading from files. Course data is similar to that of Assignment 2, except that “GradedCourse” and “NonGradedCourse” information can only be obtained from the text file. Create new course objects ONLY from information read from the text file.




  • A print method prints all the information stored in each course object. In addition to common information defined in “Course”, “GradedCourse” should also print the grade, while “NonGradedCourse” should also print the schedule. Note that your program MUST compute the GPA in the case of “GradedCourse”.



Mar 29, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here