Question: Draw flowgraph for the given code below: import java.util.ArrayList; import java.util.List; import java.util.Scanner; class Movie { private String title; private String genre; private int duration;

Draw flowgraph for the given code below: import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
class Movie {
private String title;
private String genre;
private int duration;
public Movie(String title, String genre, int duration){
this.title = title;
this.genre = genre;
this.duration = duration;
}
public String getTitle(){
return title;
}
public String getGenre(){
return genre;
}
public int getDuration(){
return duration;
}
}
class Showtime {
private Movie movie;
private String time;
public Showtime(Movie movie, String time){
this.movie = movie;
this.time = time;
}
public Movie getMovie(){
return movie;
}
public String getTime(){
return time;
}
}
class Seat {
private int seatNumber;
private boolean isAvailable;
public Seat(int seatNumber){
this.seatNumber = seatNumber;
this.isAvailable = true;
}
public int getSeatNumber(){
return seatNumber;
}
public boolean isAvailable(){
return isAvailable;
}
public void setAvailable(boolean available){
isAvailable = available;
}
}
class Theater {
private int theaterNumber;
private List showtimes;
private List seats;
public Theater(int theaterNumber){
this.theaterNumber = theaterNumber;
this.showtimes = new ArrayList<>();
this.seats = new ArrayList<>();
initializeSeats();
}
private void initializeSeats(){
for (int i =1; i <=10; i++){
seats.add(new Seat(i));
}
}
public int getTheaterNumber(){
return theaterNumber;
}
public List getShowtimes(){
return showtimes;
}
public List getSeats(){
return seats;
}
}
class Cinema {
private List theaters;
public Cinema(){
theaters = new ArrayList<>();
initializeTheaters();
}
private void initializeTheaters(){
for (int i =1; i <=3; i++){
theaters.add(new Theater(i));
}
}
public List getTheaters(){
return theaters;
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!