Question: Write a JAVA program to build an appropriate implementation for the UML diagram below, which models a platform for watching different types of shows. Account

 Write a JAVA program to build an appropriate implementation for theUML diagram below, which models a platform for watching different types of

Write a JAVA program to build an appropriate implementation for the UML diagram below, which models a platform for watching different types of shows. Account - userName: String - password: String Platform - accounts: ArrayList - shows: ArrayList + Account + Platform + signUpo: void + login(): Account + searchShows(): void + display Top 100: void > Ratable + MAX: int=10 K + updateRate(): void > java.lang. Comparable K Show # name: String # times Watched: int #description: String # rate: double + Show(name: String, description: String) + updateRate(): void + toString(): String + equals(o:Object):boolean + compareTo(s:Show): int + getDuration(): int + compareTo(s: Show):int Movie - duration: int - production Year:int + Movie(name: String, description: String, duration: int, production Year:int) + toString(): String + equals(o:Object):boolean + getDuration(): int Series - numOfEpisodes: int - episode Duration: int + Series(name: String, description: String, numOfEpisodes:int, episode Duration: int) + toString():String + getDuration(): int In the Show class: - The constructor initializes the name and description data fields with the passed parameters. The times Watched and rate must be initialized to zero. - The update Rate method should read the user rate from the user in an input dialog box and re- compute the rate data field. Note that: The rate is always computed as the average rates entered by the users. Assume that all users who watched a show must rate it, which means that the number of times a show is watched is the same as the number of times it is rated. If the user does not enter a rate between 0 and the max defined by the Ratable interface, your code should keep on asking the user to enter a rate in the valid range. The updateRate method should also increment the number of times the show is watched (times Watched data field). The toString method must be overridden such that it returns a String that contains the name and rate on one line, the description on the next line in the following format: name-rate description The equals method must be overridden such that two shows are equal if they have the same name. If an object of type other than show is passed, it must return false. - The compareTo method must be overridden such that the rates of the two objects are compared, and returns 1 if the first object rate is larger than the second, 0 if they have equal rates, and -1 if the first object rate is less than the second. In the Movie class: - The constructor must invoke the super class constructor in order to initialize inherited data fields. - The toString method must be overridden such that it invokes the super class toString method and add to it on a new line the duration and production year. - The equals method must be overridden such that two movies are equal if they have the same name (invoke super class equals method), and if they have the same production year. - The getDuration method must be overridden to return the duration data field. In the Series class: - The constructor must invoke the super class constructor in order to initialize inherited data fields. - The toString method must be overridden such that it invokes the super class toString method and add to it on a new line the number of episodes and the episode duration. - The getDuration method must be overridden to return the duration of all series episodes by multiplying the number of episodes by the episode duration In the Account class: - The ArrayList of shows must be initialized to be empty. - The constructor must ask the user to enter his user name and password in input dialog boxes

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 Databases Questions!