Question: (Translate into Java Eclipse code) Group Program name: String - audienceRating: double -channels Channel - name : String - language : String - Views :
(Translate into Java Eclipse code)


Group Program name: String - audienceRating: double -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 calculate Rating : double + display : void +Group/String, int) + addChannel Channel): boolean +removeChannelString): boolean 1 + countLive Sports(String, int): int + getNewslint, double): News #programs 30 + Program(double) getAudienceRating: double toString(): String 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: audienceRating: the audience rating of the program Methods: o Program(double audienceRating): constructor o getAudienceRating: 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 o live: attribute that indicates if the channel is live or not onbProgs: number of programs in the channel Methods: o 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 calculateRating0: 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: 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 o 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 countLiveSports(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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
