Question: This is the Student Test code: public class TestStudent { public static void main(final String[] args) { // Test 1 // Check setNames sets name

 This is the Student Test code: public class TestStudent { public

static void main(final String[] args) { // Test 1 // Check setNames

This is the Student Test code:

public class TestStudent { public static void main(final String[] args) { // Test 1 // Check setNames sets name and and getFullName returns name. System.out.println("Test 1"); Student student = new Student(); student.setNames("Patricia", "Nombuyiselo", "Noah"); if (student.getFullName().equals("Patricia N. Noah")) { System.out.println("Pass"); } else { System.out.println("Fail"); } // Test 2 // Check getFullName returns name, and DOES NOT change the Student object. System.out.println("Test 2"); student = new Student(); student.setNames("Nomalizo", "Frances", "Noah"); if (student.getFullName().equals(student.getFullName())) { System.out.println("Pass"); } else { System.out.println("Fail"); } } }

This question concerns (i) writing a Student class to model a student's name, composed of a first name, middle name and last name, and (i) using a supplied test suite to drive the process The Student class should meet the following specification: Class Student A Student object represents a student. A student has a first name, middle name and last name. Methods public void setNames(String first, String middle, String last) I/ Set the first, middle and last names of this Student object. public String getFullNamel) //Obtain the full name of this Student with the middle name converted to an initial only. Thinking of the problem in terms of testing, there are three requirements that must be met: A. The setNames () method sets the names stored in the object i.e. the values of firstName, middleName, lastName. The getFullName() method obtains the name of the student with the middle name converted to an initial only. B. C. The getFulIName() method does not change anything-Le.it does not modify the values of firstName, middleName, lastName Note that, these requirements are interdependent i.e. you can only check setNames works by using getFullName), and you can only check getFullName () works by first using setNames ()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!