(Translate into Java Eclipse code)
Group name: String channels Channel -name: String - language : String - views : int - live : boolean #nbProgs - Channel(String. String, int, boolean) + addProgram Program): boolean + getName(): String + getLanguage(): String + getViews(); int + is Live(): boolean + calculateRating(): double + display:void Program - audienceRating : double #programs + Program(double) 30.getAudienceRating : double + toString): String + Group(String, int) + addChannel(Channel): boolean + removeChannel(String) : boolean 1 + countLiveSports(String, int): int + getNews(int, double): News [] 1 Sports News - matches: int - segments: int -breaking: int + News(String, String, int, boolean, int, int) + getBreaking): int + Sports(String, String, int, boolean, int) + getMatches(); int Program class: Attributes: o audienceRating: the audience rating of the program . Methods: o Program(double audienceRating): constructor getAudienceRatingo: returns the audience rating of the program otoString(): returns a string representing the info of the program Channel class: Attributes: o name: the name of the channel o language: the language of the channel view: the number of views for the channel olive: attribute that indicates if the channel is live or not onbProgs: number of programs in the channel Methods: Channel(String name, String language, int views, boolean live): constructor o addProgram(Program p): adds program p to the channel o getName(): returns the name of the channel o getLanguage(: returns the language of the channel o getViews(): returns the views of the channel o isLive(): returns whether the channel is live or not o calculateRating(): calculates the rating of the channel in the following way: Sports: views / matches 2 News: (views / breaking) + ( audienceRating of all programs in the channel / segments) o displayo: prints out the info of the channel and its programs Sports class: . Attributes: o matches: the number of matches the channel covers Methods: o Sports(String name, String language, int views, boolean live, int matches): constructor o getMatches(): returns the number of matches in the channel News class: Attributes: o segments: the number of news segments in the channel o breaking: the number of breaking news the channel covers . Methods: o News(String name, String language, int views, boolean live, int segments, int breaking): constructor o getBreakingo: returns the number of breaking news in the channel Group class: . Attributes: o name: the name of the group . Methods: o Group(String name, int size): constructor addChannel(Channel e): adds channel c in the group if there's space and it's not already there o removeChannel(String name): removes the channel name if it exists and shifts the rest of the elements if needed o countLive Sports(String language, int matches): returns the number of sports channel that are live and in language with matches greater than or equal to matches o getNews(int breaking, double rating): returns an array of News channels having breaking news greater than breaking and rating at least rating Exercise 1: Translate into Java code all the previous classes. Exercise 2: Write a main method and test all previous functionalities. Group name: String channels Channel -name: String - language : String - views : int - live : boolean #nbProgs - Channel(String. String, int, boolean) + addProgram Program): boolean + getName(): String + getLanguage(): String + getViews(); int + is Live(): boolean + calculateRating(): double + display:void Program - audienceRating : double #programs + Program(double) 30.getAudienceRating : double + toString): String + Group(String, int) + addChannel(Channel): boolean + removeChannel(String) : boolean 1 + countLiveSports(String, int): int + getNews(int, double): News [] 1 Sports News - matches: int - segments: int -breaking: int + News(String, String, int, boolean, int, int) + getBreaking): int + Sports(String, String, int, boolean, int) + getMatches(); int Program class: Attributes: o audienceRating: the audience rating of the program . Methods: o Program(double audienceRating): constructor getAudienceRatingo: returns the audience rating of the program otoString(): returns a string representing the info of the program Channel class: Attributes: o name: the name of the channel o language: the language of the channel view: the number of views for the channel olive: attribute that indicates if the channel is live or not onbProgs: number of programs in the channel Methods: Channel(String name, String language, int views, boolean live): constructor o addProgram(Program p): adds program p to the channel o getName(): returns the name of the channel o getLanguage(: returns the language of the channel o getViews(): returns the views of the channel o isLive(): returns whether the channel is live or not o calculateRating(): calculates the rating of the channel in the following way: Sports: views / matches 2 News: (views / breaking) + ( audienceRating of all programs in the channel / segments) o displayo: prints out the info of the channel and its programs Sports class: . Attributes: o matches: the number of matches the channel covers Methods: o Sports(String name, String language, int views, boolean live, int matches): constructor o getMatches(): returns the number of matches in the channel News class: Attributes: o segments: the number of news segments in the channel o breaking: the number of breaking news the channel covers . Methods: o News(String name, String language, int views, boolean live, int segments, int breaking): constructor o getBreakingo: returns the number of breaking news in the channel Group class: . Attributes: o name: the name of the group . Methods: o Group(String name, int size): constructor addChannel(Channel e): adds channel c in the group if there's space and it's not already there o removeChannel(String name): removes the channel name if it exists and shifts the rest of the elements if needed o countLive Sports(String language, int matches): returns the number of sports channel that are live and in language with matches greater than or equal to matches o getNews(int breaking, double rating): returns an array of News channels having breaking news greater than breaking and rating at least rating Exercise 1: Translate into Java code all the previous classes. Exercise 2: Write a main method and test all previous functionalities