create a "UML Class Diagram" with the files below. I attempted to mae it myself, but I dont know if its right or not.
Application.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
import java.awt.print.Paper;
/**
*
* @author MoaathAlrajab
*/
public class Application {
//Application to describe a publication
privateWrittenPiecepaper ;
privateIllustrationdrawing;
publicApplication(WritingFactoryfactory) {
drawing = factory.drawSomething();
paper = factory.writeSomething();
}
publicvoidrevealContent(){
paper.typeOfPiece();
drawing.depictInfo();
}
}
Book.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public class Book implements WrittenPiece {
@Override
publicvoidtypeOfPiece() {
System.out.println("Book is a written piece");
}
}
Charts.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public class Charts implements Illustration {
@Override
publicvoiddepictInfo() {
System.out.println("Charts is a type of illustration usually included+"
+ "in written pieces such as books and articles. ");
}
}
ComicBookFactory.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public class ComicBookFactory implements WritingFactory {
@Override
publicIllustrationdrawSomething() {
returnnewHandDrawing();
}
@Override
publicWrittenPiecewriteSomething() {
returnnewBook();
}
}
DriverClass.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public class DriverClass {
privatestaticApplicationconfigureApplication(){
Applicationapp;
WritingFactoryfactory;
StringprintName = "Check the config file for cominc";
if (printName.contains("paper")) {
factory = newComicBookFactory();
app = newApplication(factory);
} else {
factory = newMenuscriptFactory();
app = newApplication(factory);
}
returnapp;
}
publicstaticvoidmain(String[] args) {
Applicationapp = configureApplication();
app.revealContent();
}
}
Essay.java
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public class Essay implements WrittenPiece {
@Override
publicvoidtypeOfPiece() {
System.out.println("Essay is a written piece");
}
}
HandDrawing.java:/
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public class HandDrawing implements Illustration {
@Override
publicvoiddepictInfo() {
System.out.println("Hand drawing is traditionally the meaning "
+ "of illustration ");
}
}
Illustration.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public interface Illustration {
voiddepictInfo();
}
MenuscriptFactory.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public class MenuscriptFactory implements WritingFactory {
@Override
publicIllustrationdrawSomething() {
returnnewCharts();
}
@Override
publicWrittenPiecewriteSomething() {
returnnewPublicationPaper();
}
}
PublicationPaper.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public class PublicationPaper implements WrittenPiece{
@Override
publicvoidtypeOfPiece() {
System.out.println("This is a publication article");
}
WritingFactory.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public interface WritingFactory {
Illustration drawSomething();
WrittenPiece writeSomething();
}
WrittenPiece.java:
package com.mycompany.csc325_abstractfactorydesignpattern;
/**
*
* @author MoaathAlrajab
*/
public interface WrittenPiece {
void typeOfPiece();
}
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images
- I need this assignment done in java with screenshots of it running.arrow_forwardWRITE JAVA CODE ACCORDING TO THE DEIGN PATTERN BY LOOKING AT THE CLASS DIAGRAM The function of the code is up to you, let it be suitable for the content of the design pattern, as long as you write according to which pattern you are coding and comment lines.arrow_forward● • Compile the Automobile.java class and correct any errors. Create another file named TestAutomobile.java that contains the main method. Create several Automobile objects and test that your constructor and methods work as described. ● Create a UML diagram of the Automobile class. Create the Automobile.java class. It should have the instance variables, constructor(s) and methods located below. Automobile Instance variables Reminder: + indicates public, - indicates private - make (String): The automobile make (Ford, Acura, etc). - model (String): The automobile model (Escapade, ZDX, etc). - power (boolean): Holds the value true if the power is on and false if the power is off. The default value is false. . - gear (char): Holds the value of the gear that the automobile is in. The default value is P (Park). Other values include D (Drive), and R (Reverse). Automobile constructors • One constructor that takes two parameters and sets the make and model instance variables. . - volume (int):…arrow_forward
- This code is in java. Craps.java file is your main file. 1) you need to make a Die.java file This file will have a constructor method that creates a 6-sided die and another method that rolls the die and returns its value. 2) in the Craps.java Ask the user if they want to play the pass line or the don’t pass line. Create your die objects Roll the dice. Find the sum. Print out the dice values and the sum ( 1 + 3 = 4). Determine if the player wins or loses on the first roll (based on pass or don’t pass) or if they rolled the point value. If they win on the first roll print out you won If they lose on the first roll print out you lose Otherwise print out the point value. (for don’t pass, you need to take into account a tie.)arrow_forwardRefer to the following interface: Provide two examples (screenshots) that in many ways could improve the above or similar interface using the principles of direct manipulation. Explain the relevant improvements as well. (Examples might have different object, labels and organization)arrow_forwardobject-oreinted programming. need the full code together with the comments.arrow_forward
- PATTERNS: Shapes Using Python, recreate (as close as possible) the pattern given using only one class - the Pattern class. You are only allowed to use PIL.Image and PIL.ImageDraw from the Pillow Library, and pi, cos, and pi. Its data attributes are as follow: width_height – 2-digit tuple containing the width and height of the image space – Image object (with 8-bit RGB color space, specified size, and background color) draw – Image object that performs as the drawing context of the space background – 3-digit tuple of the 8-bit RGB background color of the image or picturearrow_forwardPlease teach me how to fix an error from my JAVA source code. I have set up the source code with class name "ProductionWorker" and there were a error occured on second page of sceenshot where it is highlighted. //import the file import java.util.*; //create the class class Employee { //create the variable private String emp_num; //create the date variable private Date hiring_date; // default constructor public Employee() { //assign the emp num. this.emp_num = "000-A"; //assign the Date this.hiring_date = new Date(); } // constructor parameter public Employee(String emp_num, Date hiring_date) { this.emp_num = emp_num; this.hiring_date = hiring_date; } // getter method public String getEmployeeNumber() { return this.emp_num; } // call the gethiringdate function public Date gethiringDate() { // return the date return this.hiring_date; } // setter method public void setEmployeeNumber(String emp_num) { //set the emp num. this.emp_num = emp_num; } //set the hiring date public void…arrow_forwardTo use any of the prewritten classes besides those in the java.lang package, you must___ a. use the entire path with the class name b. import the class c. import the package of which the class you are using is a part d. use any of these methodsarrow_forward
- ModalProp detailsanimationType it's an enum of ('none', 'slide', 'fade') and it controls modal animation.visible its a bool that controls modal visiblity.onShow it allows passing a function that will be called once the modal has been shown.transparent bool to set transparency.onRequestClose (android) it always defining a method that will be called when user tabs back buttononOrientationChange (IOS) it always defining a method that will be called when orientation changessupportedOrientations (IOS) enum('portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right')Modal component is a simple way to present content above an enclosing view.using given Modal make a Basic Example?arrow_forwardWhen comparing two objects using the equals method inherited from the Object class, what is actually compared is the contents of the objects in java. True or Falsearrow_forwardClass and Objets will be applied for the solution of given A Coffee Shop offers cups of : Coffee 1.5 $ Coffee Cake 3$ If the total charge exceeds 20$ the customer gets a discount of 5%. Create a java application with bill class that includes bill id, customer name, coffeeItems, cakeItems and the charge before and after discount. This class should implement addItems() method to add items to the customer bill and calcCharge() method to calculate the total charge. Class coffeeShop is expected to create a bill, adds items to this bill using menu and prints the charge.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education