Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

urgent java code. everything is clear so far but if you need extra info I will be more than happy to provide it public class

urgent java code. everything is clear so far

but if you need extra info I will be more than happy to provide it

image text in transcribed

public class Course
{
// declaring all instance variables
private String CourseName;
private int CourseNumber;
private String CourseCode;
private String Department;
private String Instructor;
private List studentList;
//overloaded constructors
public Course (String courseName, int courseNumber, String department,
String courseCode, String instructor)
{
CourseName = courseName;
CourseNumber = courseNumber;
CourseCode = courseCode;
Department = department;
Instructor = instructor;
studentList = new ArrayList ();
}
//All getters and setters methods
public String getCourseName ()
{
return CourseName;
}
// CourseName setter method
public void setCourseName (String courseName)
{
CourseName = courseName;
}
//CourseNumber getter Method
public int getCourseNumber ()
{
return CourseNumber;
}
//CourseNumber setter Method
public void setCourseNumber (int courseNumber)
{
CourseNumber = courseNumber;
}
//CourseCode getter Method
public String getCourseCode ()
{
return CourseCode;
}
//CourseCode setter Method
public void setCourseCode (String courseCode)
{
CourseCode = courseCode;
}
//Department Getter Method
public String getDepartment ()
{
return Department;
}
//Department Setter method
public void setDepartment (String department)
{
Department = department;
}
//Instructor Getter Method
public String getInstructor ()
{
return Instructor;
}
//Instructor setter method
public void setInstructor (String instructor)
{
Instructor = instructor;
}
//Student List Getter method
public List getStudentList ()
{
return studentList;
}
//Student List Setter method
public void setStudentList (Student student)
{
this.studentList.add (student);
}
//toString Overrided method
@Override public String toString ()
{
return "Course{" +
"CourseName='" + CourseName + '\'' +
", CourseNumber=" + CourseNumber +
", CourseCode='" + CourseCode + '\'' +
", Department='" + Department + '\'' +
", Instructor='" + Instructor + '\'' + '}';
}
}
Student Class Code:import java.util.ArrayList;
import java.util.Scanner;
public class Student
{
//all instance variables
String n, ID, gender;
int courseCount;
ArrayList mList = new ArrayList ();
//overloaded constructor
public Student (String n, String ID, String gender, int courseCount)
{
this.n = n;
this.ID = ID;
this.gender = gender;
this.courseCount = courseCount;
this.addCourseDetails (courseCount);
}
//addcourseDetail method to add the course
void addCourseDetails (int courseCount)
{
Scanner scanner = new Scanner (System.in);
System.out.println ("Please enter the course's details");
for (int i = 0; i
{
System.out.print ("Course Name: ");
String courseName = scanner.next ();
System.out.print ("Enter Course Number: ");
int courseNumber = scanner.nextInt ();
System.out.print ("Department:");
String department = scanner.next ();
String courseCode = department + courseNumber;
System.out.print ("Instructor Name:");
String instructorName = scanner.next ();
mList.
add (new
Course (courseName, courseNumber, department, courseCode,
instructorName));
}
}
//toString Overrided method
public String toString ()
{
String s =
"Name: " + this.n + ", ID: " + this.ID + ", Gender: " + this.gender +
", Major: " + ", Course Number: " + this.courseCount + " ";
for (Course course:mList)
{
s += course.toString ();
}
return s;
}
}
Exercise 3: GradeManager.javaj| Create a driver class Grade Manager with the main method to do the following: a. Read the students' numeric grades from the grades_CMP444.txtfile (Figurel) and save them in an array of grades in the course class. The first line contains the course code and the grades are listed in this format: Student ID --- Grade. b. Prompt and allow the user to manage the grades with the following options (Use the Math class methods): 1. Print the course details. 2. Print the grades of students in the course in the following format: Student ID: Letter Grade: NumericValue 3. Compute the average, standard deviation of the grades in the course. 4. Identify the Maximum and Minimum grades in a class. CMP444 00032146 - 8795 00044261 - 92 25 00075191 -95.75 00080570 - 75 50 00015560 - 82.00 00013858 - 9450 00044265-73 25 00081651 - 65 25 00070219 - 89.75 00011255 - 97 50 Figure I: Content of grades_CMP 444.txt file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Chemical Engineering Thermodynamics

Authors: J.M. Smith, Mark Swihart Hendrick C. Van Ness, Michael Abbott

9th International Edition

1260597687, 978-1260597684

More Books

Students also viewed these Chemical Engineering questions

Question

the quest to maximize profitability should be constrained by

Answered: 1 week ago

Question

Explain the importance of staffing in business organisations

Answered: 1 week ago

Question

What are the types of forms of communication ?

Answered: 1 week ago

Question

Explain the process of MBO

Answered: 1 week ago