EDIT*****
I figured it out. I will post the solution in a bit...
I could use some help with the following problem that implementsthe Abstract Factory Pattern:
Consider 2 SALES RECEIPT classes: RECEIPT1 and RECEIPT2.
RECEIPT1 has a method that displays the message “Receipt Body1”.
RECEIPT2 has a method that displays the message “Receipt Body2”. A SALES RECEIPT object has exactly 1 header and 1 footer.
There are 2 possible HEADER classes (HEADER1 and HEADER2) and 2possible FOOTER classes (FOOTER1 and FOOTER2). HEADER1 class has amethod that displays the message “Header 1”. HEADER2 class has amethod that displays the message “Header 2”. FOOTER1 class has amethod that displays the message “Footer 1”. FOOTER2 class has amethod that displays the message “Footer 2”. HEADER1 should be usedwith RECEIPT1 and FOOTER1. HEADER2 should be used with RECEIPT2 andFOOTER2.
You must use the abstract factory pattern tocreate sales receipts.
1) Draw the UML class diagram.
2) Provide the implementation code of the UML class diagramgiven in question 1 in Java. The object created by the client codeshould display the following message: ”Header 1 Receipt Body 1Footer 1”.