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
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
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!
-
Marwa needs to have US$15,000 at the end of 5 years to fulfill her goal of purchasing a small sailboat. She is willing to invest the funds as a single amount today but wonders what sort of investment...
-
A simple telephone system consists of two end offices and a single toll office to which each end office is connected by a 1-MHz full-duplex trunk. The average telephone is used to make four calls per...
-
It is proposed that the vibration of the foundation of an internal combustion engine be measured over the speed range \(500 \mathrm{rpm}\) to \(1500 \mathrm{rpm}\) using a vibrometer. The vibration...
-
A city is having scal problems in 2015. It expects to report a decit in its general fund, the only fund that is statutorily required to be balanced. To eliminate the anticipated decit the city opts...
-
lim x-3x-10 x-2 x+4x+4 Find the following limit algebraically, if it exists.
-
Given the following table (also available in the online resources) reporting the LOS for 60 pulmonary patients, create a statistics graph (histogram) of the number of pulmonary patients by their LOS...
-
A binary mixture of species a and b behaves as an ideal gas at 300 K and 1 bar. Calculate the partial molar Gibbs energy of species a, Ga, and the total solution Gibbs energy, g, at the following...
-
Research finds that the social elite tend to be omnivorous: They embrace and seek variety in all forms of consumption, from music to food. But being omnivorous is not just happening amongst the...
-
Death also involves rites of passage. Funeral ceremonies help the living organize their relationships with the deceased. Action is tightly scripted, down to the costumes (e.g., the ritual black...
-
Many colleges boast unique rituals in which students engage in some scripted group activity, though in recent years, some institutions have abolished these because of safety concerns or because the...
-
An important debate has existed for years about whether gender stereotypes in advertising influence and perpetuate existing values and norms around stereotyping at large, or whether advertising...
-
Which of the following statements with reference to extortion is true? a. It is a crime even if the extortion message is only sent but not received. b. The words "pay up or else" are insufficient to...
-
In order to get an idea on current buying trends, a real estate agent collects data on 10 recent house sales in the area. Specifically, she notes the number of bedrooms in each house as follows: a....
-
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...
-
Find the z-score that corresponds to each percentile. 1. P 5 2. P 50 3. P 90
-
A veterinarian records the weights of cats treated at a clinic. The weights are normally distributed, with a mean of 9 pounds and a standard deviation of 2 pounds. Find the weight x corresponding to...
-
In a randomly selected sample of women ages 20 34, the mean total cholesterol level is 179 milligrams per deciliter with a standard deviation of 38.9 milligrams per deciliter. Assume the total...
Study smarter with the SolutionInn App