Question: Part 2 : // EntertainmentMedia.java public abstract class EntertainmentMedia { private String title; private double productionBudget; // Default Constructor public EntertainmentMedia() { } /** *

Part 2 :
// EntertainmentMedia.java
public abstract class EntertainmentMedia { private String title; private double productionBudget;
// Default Constructor public EntertainmentMedia() {
} /** * @param title * @param productionBudget */ public EntertainmentMedia(String title, double productionBudget) { this.title = title; this.productionBudget = productionBudget; }
public String getTitle() { return title; }
public void setTitle(String title) { this.title = title; }
public double getProductionBudget() { return productionBudget;
}
public void setProductionBudget(double productionBudget) {
this.productionBudget = productionBudget; }
public abstract double getprofit(); }
==================================
// TvSeries.java
public class TvSeries extends EntertainmentMedia {
private int nbEpisodes;
private boolean goodratings;
// Default Constructor
public TvSeries() {
}
/**
* @param title
* @param productionBudget
* @param nbEpisodes
* @param goodratings
*/
public TvSeries(String title, double productionBudget, int nbEpisodes,
boolean goodratings) {
super(title, productionBudget);
this.nbEpisodes = nbEpisodes;
this.goodratings = goodratings;
}
public int getNbEpisodes() {
return nbEpisodes;
}
public void setNbEpisodes(int nbEpisodes) {
this.nbEpisodes = nbEpisodes;
}
public boolean isGoodratings() {
return goodratings;
}
public void setGoodratings(boolean goodratings) {
this.goodratings = goodratings;
}
@Override
public double getprofit() {
if (goodratings) {
return nbEpisodes * 150000 - getProductionBudget();
} else {
return nbEpisodes * 50000 - getProductionBudget();
}
}
}
==================================
// Movie.java
public class Movie extends EntertainmentMedia {
// Default Constructor
public Movie() {
}
private int totalNumTicketsSold;
private double revenuePerTicket;
/**
* @param title
* @param productionBudget
* @param totalNumTicketsSold
* @param revenuePerTicket
*/
public Movie(String title, double productionBudget,
int totalNumTicketsSold, double revenuePerTicket) {
super(title, productionBudget);
this.totalNumTicketsSold = totalNumTicketsSold;
this.revenuePerTicket = revenuePerTicket;
}
public int getTotalNumTicketsSold() {
return totalNumTicketsSold;
}
public void setTotalNumTicketsSold(int totalNumTicketsSold) {
this.totalNumTicketsSold = totalNumTicketsSold;
}
public double getRevenuePerTicket() {
return revenuePerTicket;
}
public void setRevenuePerTicket(double revenuePerTicket) {
this.revenuePerTicket = revenuePerTicket;
}
@Override
public double getprofit() {
return totalNumTicketsSold * revenuePerTicket - getProductionBudget();
}
}
==================================
// Test.java
public class Test {
public static void main(String[] args) {
TvSeries tv = new TvSeries("Deep into the Shadow", 7500000, 90, true);
Movie m = new Movie("24 Hours", 500000, 15000, 100);
EntertainmentMedia em[] = { tv, m };
for (int i = 0; i
if (em[i] instanceof TvSeries)
System.out.println("TV Series Profit :$" + em[i].getprofit());
else if (em[i] instanceof Movie) System.out.println("Movie Profit :$" + em[i].getprofit());
}
}
}
-------------------------------------------------------------
Part 2 UML Diagram :
Part 2 Question :

Part-4: Java FX Create a JavaFx project that demonstrates various topics you have learnt like, creating structure of JavaFx, Panes, UI Controls, Shapes and events-driven programming for different controls. To do this, use the classes from Part-2. Create a window that consists of the following: Window title: "Title of your project. Design your window by using different User Interface Control like Text Field, Labels, Checkbox / Radio button, Combo box, List box, etc.... Use the data fields from the part-2, to design the nodes of the window. (Minimum five different user interface controls should be used. Use the concept of the Events Driven Programming (EDP) in order to activate the following GUI components (Buttons, radio buttons, check box, etc..) to activate the events to some nodes in your window to implement actions. (Minimum three different events should be created) Include the below in your project report: Screenshots of all output generated from the application. Code for all classes. . . Entertainment Media -title: String -productionBudget: String +Entertainment Media +Entertainment Media(String title, double productionBudget) +getTitle(): String +setTitle(String title): void +getProduction Budgeto: double +SetProductionBudget(double productionBudget): void +getprofit: double Movie -totalNum Tickets Sold: int -revenue Per Ticket: int +Movie +Movie(String title, double production Budget, int totalNum Tickets Sold, double revenue Per Ticket) +get TotalNum Tickets Soldo: int +setTotalNum Tickets Sold(int totalNum Tickets Sold): void +getRevenue Per TicketO: void +setRevenuePer Ticket(double revenue Per Ticket): void +getprofito: double TV Series -nbEpisodes: int -goodratings: boolean +TVSeries +TVSeries(String title, double productionBudget, int nbEpisodes, boolean goodratings) +getNbEpisodes: int +setNbEpisodes(int nbEpisodes): void +is Goodratings(): boolean +setGoodratings(boolean goodratings): void +getprofit(): double Part-4: Java FX Create a JavaFx project that demonstrates various topics you have learnt like, creating structure of JavaFx, Panes, UI Controls, Shapes and events-driven programming for different controls. To do this, use the classes from Part-2. Create a window that consists of the following: Window title: "Title of your project. Design your window by using different User Interface Control like Text Field, Labels, Checkbox / Radio button, Combo box, List box, etc.... Use the data fields from the part-2, to design the nodes of the window. (Minimum five different user interface controls should be used. Use the concept of the Events Driven Programming (EDP) in order to activate the following GUI components (Buttons, radio buttons, check box, etc..) to activate the events to some nodes in your window to implement actions. (Minimum three different events should be created) Include the below in your project report: Screenshots of all output generated from the application. Code for all classes. . . Entertainment Media -title: String -productionBudget: String +Entertainment Media +Entertainment Media(String title, double productionBudget) +getTitle(): String +setTitle(String title): void +getProduction Budgeto: double +SetProductionBudget(double productionBudget): void +getprofit: double Movie -totalNum Tickets Sold: int -revenue Per Ticket: int +Movie +Movie(String title, double production Budget, int totalNum Tickets Sold, double revenue Per Ticket) +get TotalNum Tickets Soldo: int +setTotalNum Tickets Sold(int totalNum Tickets Sold): void +getRevenue Per TicketO: void +setRevenuePer Ticket(double revenue Per Ticket): void +getprofito: double TV Series -nbEpisodes: int -goodratings: boolean +TVSeries +TVSeries(String title, double productionBudget, int nbEpisodes, boolean goodratings) +getNbEpisodes: int +setNbEpisodes(int nbEpisodes): void +is Goodratings(): boolean +setGoodratings(boolean goodratings): void +getprofit(): double
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
