Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have the UML for the java program that I\'m supposed to create. This is what m

ID: 3876287 • Letter: I

Question

I have the UML for the java program that I'm supposed to create. This is what my professor says:

Review the attached UML diagram, and build a Java program to apply your knowledge by designing the required interfaces and the classes.

Create the main method and declare three objects, one of type Book, one of type Journal, and one for a Chapter.

Call all the methods and display the references details using one of the Formats.

I'm honestly so lost and I'm not sure where to start.

IFormattableReference for matMLA for matAPA for mat Chicaao Reference author :name pubDate Calendar setAuthor setTitle setPubDate(m,d,y) set PubDatem,y) set PubDately) getAuthor getTitle get Pub Date( m,d,y) getPubDate(m,y] getPubDately) Book publisher volume number pages set Source setVolume set Number setPages get Source getVolume get Number getPages state country setPublisher set State getPublisher get City get State etCountr Chapter editor name () bookTitle pages setEditor set BookTitle getEditor getBookTitle getPages

Explanation / Answer

//1st class:
package iformattablereference;
import java.io.*;
import java.util.*;
public class IFormattableReference {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  
public void formatMLA() throws IOException{
//DO Task as required
}
public void formatAPA() throws IOException{
//DO Task as required
}
public void formatChicago() throws IOException{
//DO Task as required
Reference orrchi= new Reference();//orrchi is the object of class Reference in Chicago Format
// Calling The functions will automatically display the contents of Reference Class
orrchi.setAuthor();
orrchi.setTitle();
orrchi.setPubDate(8, 8, 2018);
orrchi.setPubDate(7, 2017);
orrchi.setPubDate(2016);
  
orrchi.getAuthor();
orrchi.getTitle();
orrchi.getPubDate(8, 8, 2018);
orrchi.getPubDate(7, 2017);
orrchi.getPubDate(2016);
}
public static void main(String[] args) throws IOException{
// TODO code application logic here
//Reference orr= new Reference();//obr is the object of class Reference
Book obb = new Book(); //obb is the object of class Book
Journal obj = new Journal();//obj is the object of class Journal
Chapter obc = new Chapter();//obc is the object of class Chapter


}
public String name()throws IOException
{
String name;
System.out.print(" Enter Name : ");
name = br.readLine();
return name;
}   
}

//2nd Class:
public class Reference extends IFormattableReference{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String author, title;
Calendar pubDate ;
  
public void setAuthor()throws IOException
{
author = name();
}
public void setTitle()throws IOException
{
System.out.print(" Enter Title : ");
title = br.readLine();
}
public void setPubDate(int m, int d, int y)throws IOException
{
pubDate=Calendar.getInstance();
y = pubDate.get(Calendar.YEAR);
m = pubDate.get(Calendar.MONTH)+1; //get(Calendar.MONTH) returns 0 to 11
d = pubDate.get(Calendar.DAY_OF_MONTH);   
}
public void setPubDate(int m, int y)throws IOException
{
pubDate=Calendar.getInstance();
y = pubDate.get(Calendar.YEAR);
m = pubDate.get(Calendar.MONTH)+1;
}
public void setPubDate(int y)throws IOException
{
pubDate=Calendar.getInstance();
y = pubDate.get(Calendar.YEAR);
}
public String getAuthor()throws IOException
{
System.out.print(" Author's Name : "+author);  
return author;
}
public String getTitle()throws IOException
{
System.out.print(" Enter Title : "+title);
return title;
}
public Calendar getPubDate(int m, int d, int y)throws IOException
{
System.out.print(" Date Of Publition : "+pubDate);
return pubDate;
}
public Calendar getPubDate(int m, int y)throws IOException
{
System.out.print(" Date Of Publition : "+pubDate);
return pubDate;
}
public Calendar getPubDate(int y)throws IOException
{
System.out.print(" Date Of Publition : "+pubDate);
return pubDate;
}
  
}

//3rd Class:
public class Journal extends Reference {
  
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String source;
int volume, number, pages;
  
public void setSource()throws IOException
{
System.out.print(" Enter source : ");
source = br.readLine();
}
public void setVolume()throws IOException
{
System.out.print(" Enter volume : ");
volume = Integer.parseInt(br.readLine());   
}
public void setNumber()throws IOException
{
System.out.print(" Enter number : ");
number = Integer.parseInt(br.readLine());
}
public void setPages()throws IOException
{
System.out.print(" Enter Pages : ");
this.pages = Integer.parseInt(br.readLine());
}
public String getSource()throws IOException
{
System.out.print(" Enter publisher : " + source);
return(source);
}
public int getVolume()throws IOException
{
System.out.print(" Volume : " + volume);
return(volume);
}
public int getNumber()throws IOException
{
System.out.print(" Number : " + number);
return(number);  
}
public int getPages()throws IOException
{
System.out.print(" Pages : " + this.pages);
return(this.pages);
}
}

//4th Class:

public class Book extends Reference {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String publisher, city, state, country;
  
public void setPublisher()throws IOException
{
System.out.print(" Enter publisher : ");
publisher = br.readLine();   
}
public void setCity()throws IOException
{
System.out.print(" Enter city : ");
city = br.readLine();
}
public void setState()throws IOException
{
System.out.print(" Enter city : ");
state = br.readLine();
}
public void setCountry()throws IOException
{
System.out.print(" Enter city : ");
country = br.readLine();
}
public String getPublisher()throws IOException
{
System.out.print(" publisher : " + publisher);
return(publisher);
}
public String getCity()throws IOException
{
System.out.print(" City : " + city);
return(city);
}
public String getState()throws IOException
{
System.out.print(" State : " + state);
return(state);  
}
public String getCountry()throws IOException
{
System.out.print(" Country : " + country);
return(country);
}
}

//5th Class:

public class Chapter extends Book{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String editorName, bookTitle;
int pages;
public void setEditor()throws IOException
{
editorName=name();
}
public void setBookTitle()throws IOException
{
System.out.print(" Enter Book Title : ");
bookTitle = br.readLine();
}
public void setPages()throws IOException
{
System.out.print(" Enter Pages : ");
this.pages = Integer.parseInt(br.readLine());
}
public String getEditor()throws IOException
{
System.out.print(" Editor's Name : " + editorName);
return(editorName);
}
public String getBookTitle()throws IOException
{
System.out.print(" Book Title : " + bookTitle);
return(bookTitle);
}
public int getPages()throws IOException
{
System.out.print(" Chapter Pages : " + this.pages);
return(this.pages);
}
  
  
}