Question

We wish to keep track of student advisees. Each advisee consists of a name, student id, concentra...

We wish to keep track of student advisees. Each advisee consists of a name, student id, concentration, number of hours completed, name of advisor, whether or not they have completed a major sheet for graduation and whether or not they have filed an intent to graduate. An advisor needs the ability to: o update as well as access each advisee’s information o display all student advisees in the system including all information formatted as shown in the example o display a list of student advisees who have been cleared for graduation ADVISEE CLASS DESCRIPTION You are to build the Advisee class. Begin by creating the UML diagram that includes the following:

• The fields necessary to maintain an advisee: o name, string (default value ETSU Student) – this is the name of the student advisee o student id, string (default value E#######) – this is the student id for ex. E0123456 o concentration, string (only available concentrations are CS, IS, IT) (default value XX) – this is the student’s major concentration. This is for Computing majors only at this point. o number of hours completed, int (default value 0) – this is the number of college credit hours the student has completed o advisor, string (default value No Advisor) – this is the name of the advisor o major sheet, boolean (default value false) – this tells if they have filed their major sheet for graduation o intent to graduate, boolean (default value false) – this tells if they have filed their intent to graduate

• Constructor methods o A default constructor (should set all attributes to default values as shown above) Note: the constructor methods should call the appropriate set methods rather than assigning values directly. For example, in the constructor, instead of assigning the default value for the name directly using name=“XXX XXXXX” call the setName method instead sending it the values for the default name setName(“XXX XXXXX”); o A constructor accepting a value for all attributes o A copy constructor Accessor and mutator methods for each attribute o The mutator for concentration should only allow the following values for concentration:

 CS, IS, IT (capitalization matters…it can come in upper or lowercase, but should be stored as uppercase)  If something other than these values is sent to the mutator, it should be assigned XX instead. o The mutator for the student id should only allow student id’s that are 8 characters long and begin with an E

 If something other than these values is sent to the mutator, it should assign the default value instead (E#######)

• Methods to perform the following operations (as mentioned above) o determine what a student advisee’s classification is based hours completed

 should be called getClassification  returns the string classification (It should return one of the following strings: Freshman, Sophomore, Junior or Senior)

 The classification can be determined as follows:

• for an undergraduate: Freshman < 30 hours, Sophomore 30-59 hours, Junior 60-89, Senior 90 and up o determine if a student has met the requirements to graduate  should be called metGraduationRequirements  returns a boolean – true if they have met all requirements, false if they have not The graduation requirements are as follows:

• student must have completed at least 120 credit hours • student must have filed an intent to graduate • student must have filed a major sheet o create a message that will tell whether or not the student has been cleared to graduate  should be called clearedToGraduateMsg  returns the string message stating whether or not they have been cleared to graduate based upon whether or not they have met the graduation requirements  If the student has met all graduation requirements, the message should state “Yes –all requirements have been met”  If the student has not met all graduation requirements, the message should state “No – “ followed by as many of the following that apply:

• not enough hours; • not completed major sheet; • not filed intent to graduate (See the example screenshots below for examples of the output)  Note: this method does NOT display the statement, it simply creates a string that holds the information in it. This string will be returned to the calling method and the calling method may then display the string.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hi,

Please find the Advisee java class as per the specification:

//////////////////

package studentadvisee;

/********************************
* Advisee Class
*
* ADVISEE CLASS DESCRIPTION
*
********************************/

public class Advisee {
   // Advisee fields
   private String name;          
   private String studentID;     
   private String concentration;
   private int hoursCompleted;  
   private String advisor;       
   private boolean majorSheet;   
   private boolean intentToGraduate;


   /**
   * @return the name
   */
   public String getName() {
       return name;
   }

   /**
   * @param name the name to set
   */
   public void setName(String name) {
       this.name = name;
   }

   /**
   * @return the studentID
   */
   public String getStudentID() {
       return studentID;
   }

   /**
   * @param studentID the studentID to set
   */
   public void setStudentID(String studentID) {
       if(studentID.length()==8 && studentID.charAt(0)=='E') {
           this.studentID = studentID;  
       }
       else
           this.studentID = "E#######";

   }

   /**
   * @return the concentration
   */
   public String getConcentration() {
       return concentration;
   }

   /**
   * @param concentration the concentration to set
   */
   public void setConcentration(String concentration) {
       if(concentration.equalsIgnoreCase("CS")||concentration.equalsIgnoreCase("IS")
               ||concentration.equalsIgnoreCase("IT")) {
           this.concentration = concentration.toUpperCase();
       }
       else
           this.concentration = "XX";
   }

   /**
   * @return the hoursCompleted
   */
   public int getHoursCompleted() {
       return hoursCompleted;
   }

   /**
   * @param hoursCompleted the hoursCompleted to set
   */
   public void setHoursCompleted(int hoursCompleted) {
       this.hoursCompleted = hoursCompleted;
   }

   /**
   * @return the advisor
   */
   public String getAdvisor() {
       return advisor;
   }

   /**
   * @param advisor the advisor to set
   */
   public void setAdvisor(String advisor) {
       this.advisor = advisor;
   }

   /**
   * @return the majorSheet
   */
   public boolean isMajorSheet() {
       return majorSheet;
   }

   /**
   * @param majorSheet the majorSheet to set
   */
   public void setMajorSheet(boolean majorSheet) {
       this.majorSheet = majorSheet;
   }

   /**
   * @return the intentToGraduate
   */
   public boolean isIntentToGraduate() {
       return intentToGraduate;
   }

   /**
   * @param intentToGraduate the intentToGraduate to set
   */
   public void setIntentToGraduate(boolean intentToGraduate) {
       this.intentToGraduate = intentToGraduate;
   }

   //no-arg or default constructor
   public Advisee()
   {
       setName("ETSU Student");
       setStudentID("E#######");
       setConcentration("XX");
       setHoursCompleted(0);
       setAdvisor("No Advisor");
       setMajorSheet(false);
       setIntentToGraduate(false);
   }

   //A constructor accepting a value for all attributes
   public Advisee(String iName, String iStudentID, String iConcentration,
           int iHoursCompleted, String iAdvisor, boolean iMajorSheet,
           boolean iIntentToGraduate)
   {
       name = iName;
       studentID = iStudentID;
       concentration = iConcentration;
       hoursCompleted = iHoursCompleted;
       advisor = iAdvisor;
       majorSheet = iMajorSheet;
       intentToGraduate = iIntentToGraduate;
   }

   //Copy Constructor
   public Advisee(Advisee anotherAdvisee)
   {
       name = anotherAdvisee.name;
       studentID = anotherAdvisee.studentID;
       concentration = anotherAdvisee.concentration;
       hoursCompleted = anotherAdvisee.hoursCompleted;
       advisor = anotherAdvisee.advisor;
       majorSheet = anotherAdvisee.majorSheet;
       intentToGraduate = anotherAdvisee.intentToGraduate;
   }

   public String getClassification()
   {
       String classification;
       if (getHoursCompleted() < 30)
           classification = "Freshman";
       else if (getHoursCompleted() < 60)
           classification = "Sophomore";
       else if (getHoursCompleted() < 90)
           classification = "Junior";
       else
           classification = "Senior";
       return classification;
   }

   public boolean metGraduationRequirements()
   {
       boolean graduationRequirements = false;

       if (getHoursCompleted() > 120 && isIntentToGraduate() == true
               && isMajorSheet() == true)
           graduationRequirements = true;
       return graduationRequirements;
   }


   public String clearedToGraduateMessage()
   {
       String graduationMessage;
       if (metGraduationRequirements())
           graduationMessage = "Yes –all requirements have been met";
       else
       {
           graduationMessage = "No - ";
           if (getHoursCompleted() < 120)
               graduationMessage += " not enough hours;";
           else if (!isMajorSheet())
               graduationMessage += " not completed major sheet;";
           else if (!isIntentToGraduate())
               graduationMessage += " not filed intent to graduate";
       }
       return graduationMessage;

   }
}


//////////////////////////////

Refactor Navigate Search Project Appium Studio Run Window Help Main Run . 4e杵 Quick Access 目Task List DAdvisee.java 3 10 publ


Hope this helps.

Add a comment
Know the answer?
Add Answer to:
We wish to keep track of student advisees. Each advisee consists of a name, student id, concentra...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Student class: Instance variables name id Constructors: Default constructor Constructor that has id and name passed...

    Student class: Instance variables name id Constructors: Default constructor Constructor that has id and name passed to the constructor Methods: Accessors int getID( ) String getName( ) Class Roster: This class will implement the functionality of all roster for school. Instance Variables a final int MAX_NUM representing the maximum number of students allowed on the roster an ArrayList storing students Constructors a default constructor should initialize the list to empty strings a single parameter constructor that takes an ArrayList<Student> Both...

  • C++ In the code cell below, define a class named Student with an integer id and...

    C++ In the code cell below, define a class named Student with an integer id and a string name. This class should have a constructor that takes two arguments: one for the id and the other for the name. Then Create another class named CollegeStudent that publicly inherits from Student. This class should have a protected member named major. It should also have a constructor that takes three arguments: id, name, and major. This constructor should delegate initializing the id...

  • You will create a class to keep student's information: name, student ID, and grade. The program...

    You will create a class to keep student's information: name, student ID, and grade. The program will have the following functionality: - The record is persistent, that is, the whole registry should be saved on file upon exiting the program, and after any major change. - The program should provide the option to create a new entry with a student's name, ID, and grade. - There should be an option to lookup a student from his student ID (this will...

  • PART I: Create an abstract Java class named “Student” in a package named “STUDENTS”. This class...

    PART I: Create an abstract Java class named “Student” in a package named “STUDENTS”. This class has 4 attributes: (1) student ID: protected, an integer of 10 digits (2) student name: protected (3) student group code: protected, an integer (1 for undergraduates, 2 for graduate students) (4) student major: protected (e.g.: Business, Computer Sciences, Engineering) Class Student declaration provides a default constructor, get-methods and set-methods for the attributes, a public abstract method (displayStudentData()). PART II: Create a Java class named...

  • In C++, Step 1: Implement the Student Class and write a simple main() driver program to...

    In C++, Step 1: Implement the Student Class and write a simple main() driver program to instantiate several objects of this class, populate each object, and display the information for each object. The defintion of the student class should be written in an individual header (i.e. student.h) file and the implementation of the methods of the student class should be written in a corresponding source (i.e. student.cpp) file. Student class - The name of the class should be Student. -...

  • Write a class called Student. The specification for a Student is: Three Instance fields name -...

    Write a class called Student. The specification for a Student is: Three Instance fields name - a String of the student's full name totalQuizScore - double numQuizesTaken - int Constructor Default construtor that sets the instance fields to a default value Parameterized constructor that sets the name instance field to a parameter value and set the other instance fields to a default value. Methods setName - sets or changes the student name by taking in a parameter getName - returns...

  • Create a java class for an object called Student which contains the following private attributes: a...

    Create a java class for an object called Student which contains the following private attributes: a given name (String), a surname (family name) (String), a student ID number (an 8 digit number, String or int) which does not begin with 0. There should be a constructor that accepts two name parameters (given and family names) and an overloaded constructor accepting two name parameters and a student number. The constructor taking two parameters should assign a random number of 8 digits....

  • Student ID: Student Name: private: string region Name; / The region's name int zip; Il The...

    Student ID: Student Name: private: string region Name; / The region's name int zip; Il The region's zip int population; Points to array of population for each year int num Years; /Number of years W Private member function to create an array of population. rray(int size) ( num Years size population- new int[size]; for (int i -0;i < size; i++) population[i]-DEFAULT POPULATION public: ll Constructor PopulationReport(string r, int z, int y) ( regionName r zip z createPopulationArray(y); J Il Please...

  • Create a Business class: Instance variables: Student id 1000 - 9999 Student name Present Student email...

    Create a Business class: Instance variables: Student id 1000 - 9999 Student name Present Student email address Present Number of hours 3.5 - 18 Two constructors should be coded, one that accepts no arguments and sets every field to its default value, and one that accepts all four fields, and assigns the passed values into the instance variables. For each instance variable create two methods; a getter and a setter. Add a static method to the class that will accept...

  • 2. Create a class named Student that contains the following » idStudent. The idStudent is an...

    2. Create a class named Student that contains the following » idStudent. The idStudent is an int variable that holds the student's matric number. name. The name field references a String object holds the student's name. . major. The major field references a String object holds the student's major. . classification. The classification field references a String object holds the student's classification level (bongsu, kecil, muda, sulung) . Constructor should accept the student's matric number, name, major and classification as...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT