Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

318) Could you please help me to solve this Java Programming problem? (PLEASE HELP ME ONLY WITH JAVA PROGRAMMING LANGUAGE) PROBLEM: Youre going to

318) Could you please help me to solve this Java Programming problem? (PLEASE HELP ME ONLY WITH JAVA PROGRAMMING LANGUAGE)

PROBLEM:

"

Youre going to create a simple student information system that can perform add/drop operations. Your project must have 4 classes: A course class, a technical elective course class which is extended from the course class, a student class and a Test class which contains the main method.

Course Class:

Course class should represent any courses. Course objects must be created from the course id. Youll get the course id from the main and course year & semester variables will be assigned according to the id variable. Lets assume were dealing with CMPE 113. Youll read 113 from the main and decide its year and semester. First digit will give information about the courses year. As you may see 113 ( [1]13) is a first grade course and it is a first semester course (11[3]). If the last digit is an odd number that means the course is a first semester course. Decide the courses year and semester by looking at the ids first and last digits. The second digit will be used to determine if a course is a techinal elective or not. If the courses ids second digit is 5 it means that this course is a technical elective. Create the object according to that information (See technical elective class for mor info.)

Course class must have the following variables:

Course name (String)

Course faculty (String)

Course credit (int)

Course id (int)

Course year (int)

Course semester (int)

Prerequisite course (Course)

And have the following methods:

Accessors (getters&setters) for the variables defined above.

A parameterized constructor that takes the name, credit, faculty and id as a parameter. Constructor should assign the year and semester variables according to the information given above.

Youll be given a course table. In that table you can see the prerequisites. If a course has a prerequisite you must assign that to the prerequisite variable.

Override ToString( ) method to print the information about the course. You can print all class variables.

Technical Elective Class:

Technical Elective class represents any techinal electives. If the courses ids second digit is 5, this course will be generated as a technical elective. Technical elective class will be extended from course class. Different from the course class t.e. class must have a thresh hold credit variable. Threshold credit variable will be sent from the main before creating the technical elective object. So check the course id first, decide if its a must or a technical elective course, if its a technical elective ask for its threshold credit variable. This threshod credit variable will be used to determine if a student is eligible for that technical elective or not. T.E courses extra variables are:

Threshold credit (double)

Its functions:

Accessors (getters&setters) for the extra variable defined above.

A parameterized constructor that takes the name, credit, faculty, threshold credit and id as a parameter. Constructor should assign the year and semester variables according to the information given above (look for the course class). Call the super method with the necessary variables.

Override ToString( ) method so that it can print about the course + its threshold credit.

Create a boolean IsEligible( ) method for your technical elective class. This method takes Student object as a parameter and checks if the students GPA is bigger than the threshold credit variable. If its method returns true, if its not method returns false.

Student Class:

Create a class that will represent the Students in a university. Your Student class should have the following variables:

Student name (String)

Student faculty (String)

Student id (int)

Semester count (int)

Credit limit for this semester (int, by default 20)

Students GPA (double)

Passed Courses (Course array)

Semester Courses (Course array)

Passed Courses represents the courses passed by the student. Youre going to use that array in order to decide if a student is eligible for a specific lesson. See Add( ) method for more information.

And have the following methods:

Accessors (getters&setters) for the variables defined above.

A parameterized constructor that takes name, faculty, id, semester count, GPA as a parameter. Your constructor should assign 20 to the credit limit by default. But if the students GPA is higher than 2.5 credit limit should be assigned as 30.

Create a method named Add( ). This method will be used to add courses to the semester courses array if the student is eligible for the specified course. This method will take a course object and after that the method will search if the sent course has a prerequisite, if the sent course has a prerequisite, method will iterate through the passed courses array, if the prerequisite is passed by the student course will be added to the Semester courses list, if not give a proper error. You should also check for the credit limit of a student. If the credit limit is reached Adding operation should give a proper message. Also check if the sent course is a technical elective or not. If it is, check if the IsEligible( ) method to decide if a students GPA is enough to take that elective course. You can check it by using instanceof keyword or by looking at the second digit of the courses id.

Override ToString( ) method in order to print information about the student objects variables. This method should also print the semester courses ids. Passed courses ids are not necessary.

Create the given courses (or technical electives) in your main method as objects. Assign if the coures has a prerequisite. Create a few student objects and assign some courses to their passed courses arrays (you can create a method for this operation or you can add them manually). Show that the Add( ) method gives proper outputs for different situations. Print one of the students semester courses informations (call courses ToString( ) methods in the array).You must test the following cases:

Create a course without a prerequisite:

A student object tries to add this course and adds succesfully.

A student object cant add this course because he/she reaches the credit limit.

Create a course (and a technical elective) with a prerequisite:

A student object tries to add this course and adds succesfully because he/she passed the prerequisite before.

A student object tries to add this course and cant add it succesfully because he/she couldnt passed the prerequisite.

A student object tries to add this technical elective course and adds succesfully because he/she passed the prerequisite and his/hers GPA is enough.

A student object tries to add this technical elective course and cant add it succesfully because he/she couldnt passed the prerequisite or his/hers GPA is not high enough.

image text in transcribed

Use this table as to get courses informations. You can create different courses if you want to but you must show all the cases defined above. Good Luck.

Output:

//Create Courses here.

Student canan created.

Student ahmet created.

//Add some passed courses to students passed courses arrays.

Canan couldnt take Cmpe114 because she didnt pass the prerequisite (cmpe113) //You can print the prerequisite if you want to.

Canan added cmpe134 succesfully.

Ahmet added Cmpe114 succesfully because he passed the prerequisite (cmpe114)//you can print the prerequisite if you want to.

"

Course ID: GPA limit Prerequisite ID: 113 113 114 225 114 226 134 109 458 225 3.0 312 318 334 114 341

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

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago