Question: Java: 1) Implement the design in the picture. ( Using Static Factory Method, Singleton and State. ) 2) Write test cases for major public methods.

 Java: 1) Implement the design in the picture. ( Using Static

Java:

1) Implement the design in the picture.

( Using Static Factory Method, Singleton and State. )

2) Write test cases for major public methods.

Can someone help to implement this design?

- status Student tuition: float name: String yrResidence: int 20: int StudentStatus tuition: float getTuition): float reurn tuition; -Student(name: Str, yrResidence: int, 20: in status: StudentStatus) createlnStateStudent(name: Stri SingletonSingleton >l kssingleton rResidence: int createOutStateStudent(name: St nd. createlntlStudent(name: Strin setStatus(status:Status): void InState(...) IntState(...) -OutState(...) etinstance rResidence: int etinstance etTuition(): floatgetTuition(): float etlnstance getTuition(): floa 20: int) getTuition): float return new Student (name, yrResidence) return status.getTuition ); Student s1 = student, create Insta testudent( s1.getTuition (); "John Smith", 18 ) ; - status Student tuition: float name: String yrResidence: int 20: int StudentStatus tuition: float getTuition): float reurn tuition; -Student(name: Str, yrResidence: int, 20: in status: StudentStatus) createlnStateStudent(name: Stri SingletonSingleton >l kssingleton rResidence: int createOutStateStudent(name: St nd. createlntlStudent(name: Strin setStatus(status:Status): void InState(...) IntState(...) -OutState(...) etinstance rResidence: int etinstance etTuition(): floatgetTuition(): float etlnstance getTuition(): floa 20: int) getTuition): float return new Student (name, yrResidence) return status.getTuition ); Student s1 = student, create Insta testudent( s1.getTuition (); "John Smith", 18 )

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!