Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Just the Function no. 5 (in bold) in Java please The public methods required of the Venue class involve 1. Venue() - A default constructor

image text in transcribed

image text in transcribed

Just the Function no. 5 (in bold) in Java please

The public methods required of the Venue class involve 1. Venue() - A default constructor 2. Venue( String name, double size, double basePrice, int lev) - A constructor that accepts a name, a size, a base price and a level. The name , size, base price and level are stored on the local instance of the Venue. The constructor also sets a unique, consecutively increasing id. The first id has value 0. (Note- the local alert level is independent of the alert level associated with the Ministry) 3. boolean available(Date date)- Returns whether the Venue is available on a specified date. Availability is determined by looking through the list of approved events to see if the date on any event matches the date in the argument. 4. int getld() - Returns the id of the venue 5. String getName() Returns the name of the venue 6. double getSize() Returns the size of the venue 7. String toString() - Return the name of the event. 8. double getEstimate(String type) Returns the cost estimate to rent the venue for the type of event. Evaluated by starting with a local representation of a base price. If however the type of the event is SPORT, TRAINING or PARTY, the method will add respectively, the value of sportPrep, trainPrep or partyPrep to the base price and return the result. 9. boolean canHold(int numPatrons)- Returns whether the Venue can hold the specified number of patrons. The method evaluates the expected separation based on the local record of the alert level, and knowledge of the Ministry's separation rules, given the level. A rudimentary calculation is then carried out to see if the number of patrons is less than (Venue size/separation). If the number is patrons is less or equal, then canHold returns true, else canHold returns false. 10. void promote Events() Prints a header for the Venue followed by the toString method of each approved events for the Venue 11. int reserve (Event event, double availal, Ministry mny) obtains approval from the Ministry to reserve an event. The method performs the following actions a. Create a new Approval Request for the Event and the Venue b. Invoke the checkApproval method of the Ministry, passing the approval Request as an argument and reading the integer result(if approval is granted the result is a positive integer, if negative, the result is -1). c. If the result of the approval check is positive, validate that the available balance on the Promoter's account is greater than or equal to the estimate for the Venue, and if yes, i. add the Event to the list of approved events on the venue. ii. Link the Event to the current venue by calling the setVenue method of the Event with the current venue as an argument d. Return the integer result obtained from checkApproval Date class 1. Date(int day) instantiates a Date object, by setting it's internal value to day 2. void setDay(int day) set's the internal value to day 3. int getDay() returns the internal value 4. Date next(int day) returns a date corresponding to argument incremented by 1 5. String toString() returns a string representation of the internal value The Event class manages event information Public methods available include 1. Event(String name, String type, int numPeople, Date date )- Initializes a local instance of an event by storing submitted data 2. String getName() returns the name 3. String getType() - returns the associated type of event 4. int getNumPeople() returns the number of people who are expected to attend the event 5. Date getDate() returns the date of the event 6. Venue getVenue() - returns the venue associated with the event returns null of no venue has yet to be assigned 7. void setVenue(Venue v) - sets the venue associated with the event to v 8. String toString() returns a string of the format "Date:"+this.getDate()+";Name:"+this.get The Promoter class represents an event organizer who conceptualizes an event and initiates the process of getting it approved. Public methods include 1. Promoter (String name, double budget, Ministry mny, Venue[] venues) Initializes an instance of a promoter, by setting a name and a budget. An association to the ministry as well as set of venues is also established. 2. double getBudget() returns the budget associated with the promoter 3. String getName() returns the name associated with the promoter 4. void payFor(Venue venue, Event event) a. Extract the type of the event b. Evaluate the cost for the event at the venue by calling the getEstimate() method c. Subtract the cost from the budget 5. int planEvent(int numPatrons, String eventType, Date date) plans an event of a given type with the specified number of patrons on the specified date. Steps include: a. Determine the set of venues that the promoter can afford b. Find the lowest cost Venue from the set of affordable venues that i. can hold the number of patrons and ii. is available c. If there is at least one Venue that meets the requirements i. Create an instance of an event ii. Call the reserve method of the Venue and capture the return value in an integer iii. If the return value is greater than or equal to 0, 1. Call the setVenue method of the event to the selected venue 2. Pay for the selected venue 3. Return the return value as the result of planEvent d. If plans for the event did not work out, return -1

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_2

Step: 3

blur-text-image_3

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

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions