Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please write the correct answer and do the main with Scanner Group name: String Program - audienceRating: double channels #programs +Group/String, int) + addChannel(Channel): boolean

please write the correct answer and do the main with Scanner image text in transcribed
image text in transcribed
image text in transcribed
Group name: String Program - audienceRating: double channels #programs +Group/String, int) + addChannel(Channel): boolean + removeChannelString): boolean 1 + countLiveSports(String, int); int + getNews{int, double): News Channel - name: String - language : String Views : int - live: boolean nbProgs Channel(String, String, int, boolean) - addProgram Program): boolean + getName: String - getLanguage: String getViews(): int isLive(): boolean calculate Rating: double display:void 30 Program(double) + getAudienceRating(): double toString: String Sports News matches: int segments int -breaking int News/String. String, int, boolean, int, inti getBreaking): int Sports(String, String, int, boolean Inti + getMatches: int Program class: Attributes: o audienceRating: the audience rating of the program Methods: o Program(double audienceRating): constructor o 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 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 calculateRatingo: 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: 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 getBreaking(): 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 c): 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

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

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions