Question: 1. Discover classes for generating a student report card that lists all classes, grades, and the grade point average for a semester. Attached is the

1. Discover classes for generating a student report card that lists all classes, grades, and the grade point average for a semester. Attached is the file with coding for the class Class, Student, and StudentReportCard. You need to implement the main method to do the following: . Create a Student object with your name . Create an array store four classes. Name array classes. . Create four Class object with your own data and store them in array . Create a StudentReportCard object with the student and classes you created. . Display student name, course and grade point average 2. Draw UML diagram for problem 1 Attached is the file with code for class Class, Student, and StudentReportCard.

Already given code:

package Problem1; /** * Describe a Student with name, grade level, and ID number */ public class Student { /** * Construct a blank student's information */ public Student() { name = IDNum = ""; gradeLevel = 0; } /** * Construct a student's information with name, age, and student ID * @param name name * @param gradeLevel grade level * @param IDNum student ID */ public Student(String name, int gradeLevel, String IDNum) { this.name = name; this.gradeLevel = gradeLevel; this.IDNum = IDNum; } /** * Get the student's name * @return the student's name */ public String getName() { return name; } /** * Get the student's grade level * @return the student's grade level */ public int getGradeLevel() { return gradeLevel; } /** * Get the student's ID number * @return student ID number */ public String getIDNum() { return IDNum; } /** * Set the student's name * @param name name */ public void setName(String name) { this.name = name; } /** * Set the student's grade level * @param gradeLevel grade level */ public void setGradeLevel(int gradeLevel) { this.gradeLevel = gradeLevel; } /** * Set the studnet's ID number * @param IDNum ID number */ public void setIDNum(String IDNum) { this.IDNum = IDNum; } /** * Display student's information with name, age, and student ID * @return student's information (name, age, and student ID) */ public String toString() { return "Name: " + name + " " + "Grade Level: " + gradeLevel + ' ' + "ID Number: " + IDNum; } private String name; private int gradeLevel; private String IDNum; } ______________________________________________________

package Problem1; /** * Describe a Class with name of subject and grade the student achieved */ public class Class { /** * Construct a blank class's information */ public Class() { subject = ""; grade = 0.0; } /** * Construct a class's information with given name of subject and grade the student achieved * @param subject name of the subject * @param grade grade the student achieved */ public Class(String subject, double grade) { this.subject = subject; this.grade = grade; } /** * Get the name of subject * @return name of subject */ public String getSubject() { return subject; } /** * Set the grade of student * @return grade of student */ public double getGrade() { return grade; } /** * Set the name of subject * @param subject name of subject */ public void setSubject(String subject) { this.subject = subject; } /** * Set the student's grade * @param grade student's grade */ public void setGrade(double grade) { this.grade = grade; } /** * Display class's information including name of subject and the grade student achieved * @return class's information (name of subject and the grade student achieved) */ public String toString() { return subject + '\t' + '\t' + '\t' + grade + ' '; } private String subject; private double grade; }

______________________________________________________

package Problem1; /** * Describe a StudentReportCard with student's information, list of classes along with grade, and average grade */ public class StudentReportCard { /** * Construct a blank student report card */ public StudentReportCard() { student = new Student(); } /** * Construct a student report card with given student's information and his/her classes' information * @param student student's information (name, age, and student ID) * @param classes an array of classes' information (subjects and grades) */ public StudentReportCard(Student student, Class[] classes) { this.student = student; this.classes = classes; } /** * Get the student's information * @return student's information (name, age, and student ID) */ public Student getStudent() { return student; } /** * Get the array of classes' information * @return an array of classes' information (subjects and grades) */ public Class[] getClasses() { return classes; } /** * Set the student's information * @param student student's information */ public void setStudent(Student student) { this.student = student; } /** * Set the array of class's information (subjects and grades) the student attends * @param classes array of class's information (subjects and grades) */ public void setClasses(Class[] classes) { this.classes = classes; } /** * Get the number of classes the student attends * @return number of classes the student attends */ public int getNumClasses() { return classes.length; } /** * Get the total grade of all classes the student attends * @return the total grade of all classes the student attends */ public double getTotalGrade() { double totalGrade = 0.0; for(Class c: classes) { totalGrade = totalGrade + c.getGrade(); } return totalGrade; } /** * Get the average grade of the student * @return average grade of the student */ public double getAverageGrade() { return getTotalGrade()/getNumClasses(); } /** * Display the student report card * @return the student report card */ public String toString() { String display = student.toString() + ' '; display = display + "-------------------------------------" + " "; for(Class c: classes) { display = display + c.toString(); } display = display + "-------------------------------------" + " "; display = display + "\t" + "\t" + " Average Grade: " + getAverageGrade() + " "; return display; }

private Student student; private Class[] classes; } _______________________________________________________

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!