The following Racket data definitions model the elimination rounds of a sports tournament (where the sport can be either soccer or baseball):
;; Tournament is either ;; - (make-init-match MatchData) ;; - (make-advance-match MatchData Tournament Tournament) (define-struct init-match (data)) (define-struct advance-match (data feeder1 feeder2)) ;; MatchData is (make-match-data String String Score) (define-struct match-data (contestant1 contestant2 score)) ;; Score is either ;; - (make-soccer-score Number Number Boolean) ;; - (make-baseball-score Number Number Number) (define-struct soccer-score (goals1 goals2 extra-time?)) (define-struct baseball-score (runs1 runs2 total-innings))Using the given Racket data definitions as a starting point, design a class hierarchy for a Java program that models a tournament. Your hierarchy should be represented using a class diagram as described in the "Migrating to Java" notes. Each box in the class diagram will specify fields only (the part of the box reserved for methods will be empty). Nested classes (see Lab 1) should be represented in the diagram with a solid arrow from the field to the box representing the type of the field. For example, in Lab 1 the Song class defined a field
onAlbum
of type
Album
Your solution should be submitted on paper (either handwritten or computer generated). If your assignment is handwritten, make sure it's legible; illegible work will not be graded. The first page of your solution should contain only your name, WPI username, and section number (the reverse side of the first page should be blank). The following page(s) should contain your class hierarchy. All pages must be stapled together. We're asking you to follow these rules so that we can get your assignments graded and returned to you as quickly as possible.