A. Create a CollegeCourse class. The class contains fields for the course ID (for example, CIS 210), credit hours (for example, 3), and a letter grade (for example, A). Include get and set methods for each field. Create a Student class containing an ID number and an array of five CollegeCourse objects.
Create a get and set method for the Student ID number. Also create a get method that returns one of the Student’s CollegeCourses; the method takes an integer argument and returns the CollegeCourse in that position (0 through 4). Next, create a set method that sets the value of one of the Student’s CollegeCourse objects; the method takes two arguments—a CollegeCourse and an integer representing the CollegeCourse’s position (0 through 4).
B. Write an application that prompts a professor to enter grades for five different courses each for 10 students. Prompt the professor to enter data for one student at a time, including student ID and course data for five courses. Use prompts containing the number of the student whose data is being entered and the course number—for example, Enter ID for student #1, and Enter course ID #5. Verify that the professor enters only A, B, C, D, or F for the grade value for each course. After all the data has been entered, display all the information in order by student then course as shown:
Student #1 ID #101 CS1 1 -- credits. Grade is A CS2 2 -- credits. Grade is B CS3 3 -- credits. Grade is C CS4 4 -- credits. Grade is D CS5 5 -- credits. Grade is F
CollegeCourse.java
public class CollegeCourse {
private String courseID;
private int credits;
private char grade;
public String getID() {
}
public int getCredits() {
}
public char getGrade() {
}
public void setID(String idNum) {
}
public void setCredits(int cr) {
}
public void setGrade(char gr) {
}
}
InputGrades.java
import java.util.*;
public class InputGrades {
public static void main(String[] args) {
// Write your code here
}
}
Student.java
public class Student {
private int stuID;
private CollegeCourse[] course = new CollegeCourse[5];
public int getID() {
}
public CollegeCourse getCourse(int x) {
}
public void setID(int idNum) {
}
public void setCourse(CollegeCourse c, int x) {
}
}
CollegeCourse.java
public class CollegeCourse {
private String courseID;
private int credits;
private char grade;
public String getCourseID() {
return courseID;
}
public void setCourseID(String courseID) {
this.courseID = courseID;
}
public int getCredits() {
return credits;
}
public void setCredits(int credits) {
this.credits = credits;
}
public char getGrade() {
return grade;
}
public void setGrade(char grade) {
this.grade = grade;
}
}
Student.java
public class Student {
private int stuID;
private CollegeCourse[] course = new
CollegeCourse[5];
public int getStuID() {
return stuID;
}
public void setStuID(int stuID) {
this.stuID = stuID;
}
public CollegeCourse getCourse(int x)
{
return course[x];
}
public void setCourse(CollegeCourse c,int x)
{
course[x] = c;
}
}
InputGrades.java
import java.util.Scanner;
public class InputGrades {
public static void main(String[] args) {
Student[] s = new
Student[10];
Scanner sc = new
Scanner(System.in);
CollegeCourse c = new
CollegeCourse();
for(int i=0;i<10;i++)
{
System.out.println("Enter ID for Student #"+(i+1));
s[i] = new
Student();
s[i].setStuID(sc.nextInt());
for(int
j=0;j<5;j++)
{
System.out.println("Enter course ID
#"+(j+1));
c.setCourseID(sc.next());
System.out.println("Enter credits for
"+c.getCourseID());
c.setCredits(sc.nextInt());
System.out.println("Enter grade for
"+c.getCourseID());
c.setGrade(sc.next().charAt(0));
s[i].setCourse(c, j);
}
}
for(int i=0;i<1;i++)
{
System.out.println("Student #"+(i+1) +" ID #"+s[i].getStuID()
);
for(int
j=0;j<5;j++)
{
System.out.println(s[i].getCourse(j).getCourseID()+ "
"+s[i].getCourse(j).getCredits()+" credits.Grade is "
+s[i].getCourse(j).getGrade());
}
}
}
}
Output

*output has been taken for only one student instead of 10, but code is working for 10 students also. you need not change anything*
A. Create a CollegeCourse class. The class contains fields for the course ID (for example, CIS 21...
A. Create a CollegeCourse class. The class contains fields for the course ID (for example, CIS 210), credit hours (for example, 3), and a letter grade (for example, A). Include get and set methods for each field. Create a Student class containing an ID number and an array of five CollegeCourse objects. Create a get and set method for the Student ID number. Also create a get method that returns one of the Student’s CollegeCourses; the method takes an integer...
A. Create a CollegeCourse class. The class contains fields for the course ID (for example, CIS 210), credit hours (for example, 3), and a letter grade (for example, A). Include get and set methods for each field. Create a Student class containing an ID number and an array of five CollegeCourse objects. Create a get and set method for the Student ID number. Also create a get method that returns one of the Student’s CollegeCourses; the method takes an integer...
Create an abstract Student class for Parker University. The
class contains fields for student ID number, last name, and annual
tuition. Include a constructor that requires parameters for the ID
number and name. Include get and set methods for each field; the
setTuition() method is abstract.
Create three Student subclasses named UndergraduateStudent,
GraduateStudent, and StudentAtLarge, each with a unique
setTuition() method. Tuition for an UndergraduateStudent is
$4,000 per semester, tuition for a GraduateStudent
is $6,000 per semester, and tuition for...
In this exercise, we will be refactoring a working program. Code refactoring is a process to improve an existing code in term of its internal structure without changing its external behavior. In this particular example, we have three classes Course, Student, Instructor in addition to Main. All classes are well documented. Read through them to understand their structure. In brief, Course models a course that has a title, max capacity an instructor and students. Instructor models a course instructor who...
Modify the objectstudent JAVA program to add a private variable zipcode, you must also add setters and getter methods for the new variable and modify the toString method. The objectstudent program is in this weeks module, you can give it a default value of 19090. class Student { private int id; private String name; public Student() { id = 8; name = "John"; } public int getid() { return id; } public String getname() { return name; } public void...
Java
Do 72a, 72b, 72c, 72d. Code & output required.
public class Employee { private int id; private String name; private int sal; public Employee(int id, String name, int sal) { super(); this.id = id; this.name = name; this.sal = sal; } public int getid) { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; public void setName(String name) { this.name = name; } public int get Sall) { return sal;...
(To be written in Java code) Create a class named CollegeCourse that includes the following data fields: dept (String) - holds the department (for example, ENG) id (int) - the course number (for example, 101) credits (double) - the credits (for example, 3) price (double) - the fee for the course (for example, $360). All of the fields are required as arguments to the constructor, except for the fee, which is calculated at $120 per credit hour. Include a display()...
Writing 3 Java Classes for Student registration /** * A class which maintains basic information about an academic course. */ public class Course { /** * Attributes. */ private String code; private String title; private String dept; // name of department offering the course private int credits; /** * Constructor. */ public Course(String code, String title, int credits) { // TODO : initialize instance variables, use the static method defined in // Registrar to initialize the dept name variable...
FOR JAVA: Summary: Create a program that adds students to the class list (see below). The solution should be named Roster402_v2.java. Allow the user to control the number of students added to the roster. Ask if the user would like to see their new roster to confirm additions. If yes, then display contents of the file, if no, end the program. ------------------------------------------------------------------------------------- List of student names and IDs for class (this will be your separate text file): Jones, Jim,45 Hicks,...
Create a DataEntryException class whose getMessage() method returns information about invalid integer data. Write a program named GetIDAndAge that continually prompts the user for an ID number and an age until a terminal 0 is entered for both. If the ID and age are both valid, display the message ID and Age OK. Throw a DataEntryException if the ID is not in the range of valid ID numbers (0 through 999), or if the age is not in the range...