Question
For this assignment, you will create a program that collects information for students and computes their GPA. You will use class Course provided to you
For this assignment, you will create a program that collects information for students and computes their GPA. You will use class Course provided to you at this link: Course.java. You are responsible for creating two separate java files. The first class is a Student class (Student.java) that has the following properties and behaviors:Members (all should be declared private) Firstname (String firstName) Lastname (String lastNname) An array of Courses (Course [] courses) MethodsConstructor Student(firstName, lastName, numCourses) The first 2 parameters are assigned to the corresponding members that belong to the object (You learned how to do this in Chap 9). The final parameter is used to initialize courses (You learned how to initialize arrays in Chapter 7). createCourse(String courseName, int creditHours, char letterGrade) This method creates a new Course and adds it to courses Hint: once you have created the course object, search through the course array to find the first element that is null and replace that with the new course computeGPA() This method computes the GPA for all courses in courses using the credit hours and grade information. The getQualityPoints method in class Course tells you how many points a course is worth in the GPA Refer to Computing GPA for a reminder of how the GPA is computed toString() insert the following line of code inside this method return "Student " + firstName + " " + lastName + " has a " + computeGPA() + " GPA"; Example output: Student Jane Doe has a 3.4 GPA The second class is a Main class (Main.java) that creates 3 students (3 separate Student objects) with the following informationName: Jane Doe (Note: number of courses is 5)List of Courses Course Name: Math, Credit Hours: 4, Letter Grade: A Course Name: English, Credit Hours: 3, Letter Grade: A Course Name: CS, Credit Hours: 4, Letter Grade: A Course Name: Chemistry, Credit Hours: 3, Letter Grade: B; Course Name: Health, Credit Hours: 2, Letter Grade: B Name: John Smith (Note: number of courses is 5)List of Courses Course Name: Math, Credit Hours: 4, Letter Grade: B Course Name: English, Credit Hours: 3, Letter Grade: B Course Name: CS, Credit Hours: 4, Letter Grade: C Course Name: Chemistry, Credit Hours: 3, Letter Grade: C; Course Name: Health, Credit Hours: 2, Letter Grade: B Name: David Hill (Note: number of courses is 3)List of Courses Course Name: Math, Credit Hours: 4, Letter Grade: C Course Name: English, Credit Hours: 3, Letter Grade: A Course Name: Health, Credit Hours: 2, Letter Grade: A Note: You will be calling the createCourse method that you defined inside the Student class inside Main.java, print each object (i.e., invoke the System.out.println that calls the toString method). course.java(http://ksuweb.kennesaw.edu/~bsetzer/1302sp18/nanoc/output/assignments/supplement/Course.java)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started