Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve in Java Programing Language classes inheritance abstract classes interfaces ThemePark Classes and Abstract Classes Visitor class with age, height and money. Attraction abstract class

Solve in Java Programing Language classes inheritance abstract classes interfaces ThemePark Classes and Abstract Classes Visitor class with age, height and money. Attraction abstract class with name, rating and visitCount (which starts at 0). Rollercoaster, Dodgems, Park and Playground classes which inherit from Attraction Stall abstract class which has name, owner name, rating and parking spot. CandyFlossStall, TobaccoStall and IceCreamStall which inherit from Stall. Interfaces Introduce some Interfaces to enable charging, restricting and reviewing attraction sand stalls: 1.ITicketed : double defaultPrice() and double priceFor(Visitor) 2.ISecurity : boolean isAllowedTo(Visitor) 3.IReviewed :int getRating() and String getName() * Have some of the classes implement these interfaces. Below are the rules about what the implementations should be: 4.Playground implements ISecurity because it has a maximum age of 15 5.TobaccoStall implements ISecurity because it has a minimum age of 18 6.Rollercoster implements ISecurity and requires a visitor to be over 145cmtall and over 12 years of age 7.All Stalls and Attractions implement IReviewed. Note: Starting prices are: $8.40 for Rollercoaster $4.50 for Dodgems 8.Rollercoaster implements ITicketed and charges tall people over 200cm double fee 9.Dodgems implements ITicketed and charge half price to children under 12years old Create ThemePark class to manage the attractions and stalls. 1.ThemePark stores all Attractions and Stalls in it. 2.ThemePark has a method getAllReviewed() which returns an ArrayList of IReviewed objects. 3.Add an empty visitedAttractions ArrayList to Visitor which stores a list of Attractions and a method to add an attraction to the list. 4.ThemePark has a method visit(Visitor, Attraction) calls for the attractionto increment its visitCount by 1 and adds the attraction to the visitors visitedAttractions list.

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions