Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Translate into Java Eclipse code) Group name: String channels Channel -name: String - language : String - views : int - live : boolean #nbProgs

(Translate into Java Eclipse code) image text in transcribed
image text in transcribed
image text in transcribed
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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Carlos Coronel, Steven Morris

14th Edition

978-0357673034

More Books

Students also viewed these Databases questions

Question

Discuss the techniques of job analysis.

Answered: 1 week ago

Question

How do we do subnetting in IPv6?Explain with a suitable example.

Answered: 1 week ago

Question

Explain the guideline for job description.

Answered: 1 week ago

Question

What is job description ? State the uses of job description.

Answered: 1 week ago

Question

What are the objectives of job evaluation ?

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago