Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

***Please follow the layout and instructions that are provided in the comments. The other answers for this were not really correct. Just need the code

***Please follow the layout and instructions that are provided in the comments. The other answers for this were not really correct. Just need the code entered where it says "CODE HERE" in bold. Please use NetBeans and all methods used are public, not private.

/* Client application class and service class Create a NetBeans project named StudentClient Add a class named Student to the StudentClient project After you have created your NetBeans Project your application class StudentClient should contain the following executable code: */ package studentclient; public class StudentClient {

public static void main(String[] args) { }

}

/* ------------------------------------------------------------------------------------------------------------------------------------------

Your service class should contain the following executable code: */

package studentclient; public class Student {

} /*In the StudentClient application class main method code the instructions to perform the tasks indicated in the remarks : */ package studentclient; public class StudentClient {

public static void main( String [] args ){ /* Declare two object references of type Student s1 and s2 and instantiate two Student objects passing three arguments to the constructor for the class. Use different values for each class object */ // CODE HERE

/* Output the name, social security number and GPA of the student from object reference s1 using the appropriate accessor methods to obtain the data */ // CODE HERE

/* Output the name, social security number and GPA of the student from object reference s2 using the toString method to return the data */ // CODE HERE

/* Using the equals method and a selection control structure (if statement), compare objects s1 and s2 and output an appropriate message indicating if the objects are equal */ // CODE HERE

/* Using the appropriate mutator methods on student object s2, change the name, social security number and GPA to the same values as in object s1. Use the set methods. */ // CODE HERE

/* Again, using the equals method and a selection control structure (if statement), compare objects s1 and s2 and output an appropriate message indicating if the objects are equal */

// CODE HERE

}

}

/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- In the Student service class code the instructions to define your Student service class structure with the appropriate constructors, mutator methods, accessor methods as well as a toString and an equals method : */ package studentclient; public class Student

{

/* Declare three instance variables to represent the student name, social security number and GPA */ // CODE HERE

/* Overloaded constructor method: Allows client to set beginning values for name, ssn, and gpa. This constructor takes three parameters and calls mutator methods to validate new values */ public Student( String newName, String newSsn, double newGpa )

{

// CODE HERE

}

/* getName accessor method */

public String getName( )

{

// CODE HERE

}

/* setName mutator method */ public void setName( String newName )

{

// CODE HERE

}

/* getSsn accessor method */ public String getSsn( )

{

// CODE HERE

}

/* setSSN mutator method */ public void setSsn( String newSsn )

{

// CODE HERE

}

/* getGpa accessor method */ public double getGpa( )

{

// CODE HERE

} /* setGpa mutator method: Allows client to set value of gpa and prints an error message if new value is either less than 0 or greater than 4.0. setGpa does not change the value of gpa if newGpa is negative or greater than 4.0 */ public void setGpa( double newGpa )

{

// CODE HERE

} /* toString method returns student name, social security number and GPA */ public String toString( )

{

//CODE HERE

}

/* equals method returns boolean. Compares two Student objects for the same field values. Returns a boolean, true if this object has the same field value as the parameter object */ public boolean equals( Object o )

{

// CODE HERE

}

}

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_2

Step: 3

blur-text-image_3

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

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions

Question

Answered: 1 week ago

Answered: 1 week ago

Question

LO3 Define the difference between job satisfaction and engagement.

Answered: 1 week ago