Create a class EventItem that holds the location of an event called location(a String), the name...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a class EventItem that holds the location of an event called location(a String), the name of the event called eventName (a String), a start hour (in 24hour format) called startTime (an integer) and an end hour (in 24 hour format) called endTime (an integer). All state values are public and a constructor is needed that takes all four parameters. [0.5 marks] Part 2: Create a class DailyScheduler that holds EventItem objects in an array called dailySchedule (The maximum size of the array is 100). It must also have a variable that holds the maximum number of EventItems(100) and another for the actual number of EventItems. All state variables must be initialized in a single constructor that takes no parameters. beclqu yam BOY [1 marks] .basham The class DailyScheduler has the following operations: TOM ei max zid void sortAscendingByEventName() - This method sorts the EventItems in ascending order using insertion sort by their eventName. [2 marks] String printDaySchedule ByLongestTime() - This method returns a string of all EventItems with their location, eventName, startTime and endTime in descending order by their Longest time (endTime-startTime). [2 marks] sele int binarySearch(String eventName) - This method uses binary search to return the location of an Eventltem with the eventName matching the parameters, or -1 if not. YOU MUST ASSSUME THE ARRAY IS SORTED IN ORDER BY EVENTNAME. [2 marks] boolean addEventItem(String location,String eventName,int startTime,int endTime) - This method must in order: 1. Check if there is space to add a new EventItem (returns false if not) 2. Sort the list in ascending order by eventName. [0.25 marks for 1 and 2] 3. Uses binarySearch_to check if there is an item with the same eventName in the array. [1 mark] 4. Creates an EventItem and adds it to the end of the array if there is no item with the same eventName and location. (returns false if there is a clash and true if not) [0.75 marks] YOU MAY ASSUME EVENT NAMES ARE UNIQUE (two EventItems will not have the same eventNames). Create a class EventItem that holds the location of an event called location(a String), the name of the event called eventName (a String), a start hour (in 24hour format) called startTime (an integer) and an end hour (in 24 hour format) called endTime (an integer). All state values are public and a constructor is needed that takes all four parameters. [0.5 marks] Part 2: Create a class DailyScheduler that holds EventItem objects in an array called dailySchedule (The maximum size of the array is 100). It must also have a variable that holds the maximum number of EventItems(100) and another for the actual number of EventItems. All state variables must be initialized in a single constructor that takes no parameters. beclqu yam BOY [1 marks] .basham The class DailyScheduler has the following operations: TOM ei max zid void sortAscendingByEventName() - This method sorts the EventItems in ascending order using insertion sort by their eventName. [2 marks] String printDaySchedule ByLongestTime() - This method returns a string of all EventItems with their location, eventName, startTime and endTime in descending order by their Longest time (endTime-startTime). [2 marks] sele int binarySearch(String eventName) - This method uses binary search to return the location of an Eventltem with the eventName matching the parameters, or -1 if not. YOU MUST ASSSUME THE ARRAY IS SORTED IN ORDER BY EVENTNAME. [2 marks] boolean addEventItem(String location,String eventName,int startTime,int endTime) - This method must in order: 1. Check if there is space to add a new EventItem (returns false if not) 2. Sort the list in ascending order by eventName. [0.25 marks for 1 and 2] 3. Uses binarySearch_to check if there is an item with the same eventName in the array. [1 mark] 4. Creates an EventItem and adds it to the end of the array if there is no item with the same eventName and location. (returns false if there is a clash and true if not) [0.75 marks] YOU MAY ASSUME EVENT NAMES ARE UNIQUE (two EventItems will not have the same eventNames).
Expert Answer:
Related Book For
Posted Date:
Students also viewed these databases questions
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
In Exercises find the values of x for which the series converges. n=0 (x + 1)n n!
-
Mariam Kmal wishes to select the better of two 10-year annuities, C and D. Annuity C is an ordinary annuity of US$2,500 per year for 10 years. Annuity D is an annuity due of US$2,200 per year for 10...
-
Excerpts from the 2017 financial statements of Finley Ltd., a service company, follow: Service revenue .................................................$240,000 Accounts receivable...
-
Plaintiffs James and Betty Tonkovich own approximately 850 acres of in Belmont County, Ohio. Plaintiffs belong to a group of landowners known as Belmont Leasing Group, which leases land for oil and...
-
On May 3, 2012, Eisler Company consigned 80 freezers, costing $500 each, to Remmers Company. The cost of shipping the freezers amounted to $840 and was paid by Eisler Company. On December 30, 2012, a...
-
The OLAP (Online Analytical Processing) discussion gives examples of multidimensional information. Give your own example of useful three-dimensional information.
-
Pedro wants to donate cash in 2022 up to the maximum deductible amount to a local nonprofit hospital. What is the maximum amount he can deduct if his AGI is $60,000?
-
What is accretion expense to be excluded from taxable income when taxes payable method is in use?
-
Name the main liquidity and profitability ratios, and explain what they indicate
-
Assume that the following information appears in a ministry's budget with respect to employee training costs:: (upcoming fiscal year) Year 1 Year 2 Year 3 Year 4 Professional development and training...
-
Why must records managers consider admissibility when deciding how long to retain records?
-
Explain why has cash flow become such an important measure of a firm's financial condition?
-
Tim works in Nova Scotia and is paid on a monthly basis. He is receiving a special pay (in addition to his 12 pays in the year) for a long service award. He is receiving an amount of $500 cash and he...
-
Dawson Companys balance sheet information at the end of 2019 and 2020 is as follows: Additional information: The company did not issue any common stock during 2020. Required : Next Level Fill in the...
-
The relationship between the novelty of a vacation destination and vacationing golfers' demographics was investigated in the Annals of Tourism Research (Apr. 2002). Data were obtained from a mail...
-
Refer to the Journal of Consumer Research (March 2003) study of how people attempt to influence the choices of others. Exercise 3.27 (p. 122). Recall that students selected three portable grill...
-
According to a 2012 Business Travel News survey, the average salary of a travel manager is $110,550. Assume that the standard deviation of such salaries is $30,000. Consider a random sample of 50...
-
Figure P2.4 shows a graph of position versus frame number from a video clip of a moving object. Describe this motion from beginning to end, and state any assumptions you make. Data from Figure P2.4...
-
What minimum information must be extracted from a video clip of a moving object in order to quantify the object's motion?
-
The sequence in Figure P2.3 represents a ball that is initially held above the ground. In the first frame the ball is released. In subsequent frames the ball falls, bounces on the ground, rises, and...
Study smarter with the SolutionInn App