Answered step by step
Verified Expert Solution
Question
1 Approved Answer
must be done in java Question#2: Design and implement a Java program using Abstract Factory and Singleton design patterns. The program displays date and time
must be done in java
Question#2: 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 formatl and format2 described above Implement the concrete factories as singleton classes Draw a UML class diagram for the programStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started