Question: Question#3: Design and implement a Java program using Abstract Factory and Singleton design patterns. The program displays date and time in one of the following

Question#3: Design and implement a Java program using Abstract Factory and Singleton design patterns. The program displays date and time in one of the following two formats: Format 1: Date: MM/DD/YYYY Time: HH:MM:SS Format 2: Date: DD-MM-YYYY Time: SS,MM,HH The following is how the program works. In the beginning, the program asks the user what display format that she wants. Then the program continuously asks the user to give one of the following commands, and performs the corresponding task. Note that the program gets the current date and time from the system clock (use the appropriate Java date and time operations for this). 'd' : display current date 't': display current time 'q': quit the program. In the program, there should be 2 product hierarchies: DateObject and TimeObject. Each hierarchy should have format1 and format2 described above. Implement the concrete factories as singleton classes. Draw a UML class diagram for the program.

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!