Question
import java.util.Scanner; create a public class student which models a student having courses and grades. The student class has two variables name and address. The
import java.util.Scanner;
create a public class student which models a student having courses and grades. The student class has two variables name and address. The courses taken and grades for the courses are kept in 2 parallel arrays. The maximum number of courses taken by student is 30. Create a constructor public Student(String name, String address). You can also initialize number of courses and the grades array. Create the public getters and setters public String getName(), public String getAddress(), public void setAddress(String address). No setter for name as it is not designed to be changed. Print the name and address of student Write a method to add a course and grade for the student public void addCourseGrade( String course, int grade) Print all courses taken and their grades by writing a method public void print- Grades() Write a method to compute the average grade for the student public double getAverageGrade() The console output will look like this. Jim(1 Happy Ave) Jim(8 maple, vaughan) Jim 8 maple, vaughan Jim IM101:89 IM102:57 IM103:96 The average grade is 80.67
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