Question Details

Object oriented programming exercise Start a new Java project called StudentsRecordApp Navigate down to /src and create the following interface and...


Object oriented programming exercise

Start a new Java project called StudentsRecordApp

 

Navigate down to /src and create the following interface and classes:

 

Interface CourseManager: Add a new Interface called CourseManager

Interface has two abstract methods:

public void addCourse();

public void dropCourse();

 

Class Student: add a class Student and Insert fields following

   String id;

   String name;

   int units;

   float grades[];

public methods:

  1. setters and getters for the data fields.
  2. public methodprintInfowhich prints out the data field values in a user friendly string.

 

Class RegisteredStudent: add a class RegisteredStudent which inherits from Student class and and interfaceCourseManager.  Provide implementation to the abstract methods to do the following:

//invoking methods “addCourse” will increase units by 2

   //invoking methods “dropCourse” will decrease units by 2

Make sure to add logic to do unit range validation check, i.e., units value can only be a positive integer, and maximum units cannot exceed 200.

 

Class CSMajorStudent: add a class CSMajorStudent which inherits from RegisteredStudent class and interfaceCourseManager.  

  • Add a data field Stringmajorand set it to "CS".
  • Override methodprintInfo to print out all data fields values, includingmajor
  • Provide implementation to the abstract methods to do the following:

   //invoking methods “addCourse” will increase units by 4

   //invoking methods “dropCourse” will decrease units by 4

Make sure to add logic to do unit range validation check, i.e., units value can only be a positive integer, and maximum units cannot exceed 200.

 

Main class: In your main class, implement the main method and meet the following requirements:

Public static void main(String[] args){

// create a RegisteredStudent object John

// set John’s name to “John Smith”

//set John's id to "0001"

// set John’s units to 12

// set John’s grades to {75, 95, 86, 91, 67, 100}

// print John’s information using printInfo()

// calculate the average grade for John

//in another line print out John’s name and average grade

//John adds three courses  (each time a course is added the units will be increased by 2)

//John drops one course (each time a course is dropped the units will be decreased by 2)

//in a new line print out John’s information

//--------Second object--------------

// create a CSMajorStudent object Mary

// set Mary’s name to “Mary Lee”

//set Mary's id to "0002"

// set Mary’s units to 16

 // Set Mary’s grades to {81, 93, 79, 90}

//Mary adds three courses  (each time a course is added the units will be increased by 4)

//Mary drops one course (each time a course is dropped the units will be decreased by 4)

//in a new line print out Mary’s name and her total units

 

}



/**

 

* CourseManager interface

 

* */

 

public interface CourseManager {

 

public abstract void addCourse();

 

public abstract void dropCourse();

 

}

 


Solution details:

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Oct 15, 2019

EXPERT

Tutor

ANSWER RATING

YES, THIS IS LEGAL

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN A DEADLINE.

Order Now