subject

A. Carly’s Catering provides meals for parties and special events. In Chapter 3, you created an Event class for the company. The Event class contains two public final static fields that hold the price per guest ($35) and the cutoff value for a large event (50 guests), and three private fields that hold an event number, number of guests for the event, and the price. It also contains two public set methods and three public get methods.

Now, modify the Event class to contain two overloaded constructors

∎ One constructor accepts an event number and number of guests as parameters. Pass these values to the setEventNumber() and setGuests() methods, respectively. The setGuests() method will automatically calculate the event price.

∎ The other constructor is a default constructor that passes "A000" and 0 to the two-parameter constructor.

Save the file as Event. java

b. In Chapter 3, you also created an EventDemo class to demonstrate using two Event objects. Now, modify that class to instantiate two Event objects, and include the following new methods in the class:

∎ Instantiate one object to retain the constructor default values

∎ Accept user data for the event number and guests fields, and use this data set to instantiate the second object. Display all the details for both objects.

Save the file as EventDemo. java.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:00
)a grad student comes up with the following algorithm to sort an array a[1..n] that works by first sorting the first 2/3rds of the array, then sorting the last 2/3rds of the (resulting) array, and finally sorting the first 2/3rds of the new array. 1: function g-sort(a, n) . takes as input an array of n numbers, a[1..n] 2: g-sort-recurse(a, 1, n) 3: end function 4: function g-sort-recurse(a, `, u) 5: if u ⒠` ≤ 0 then 6: return . 1 or fewer elements already sorted 7: else if u ⒠` = 1 then . 2 elements 8: if a[u] < a[`] then . swap values 9: temp ↠a[u] 10: a[u] ↠a[`] 11: a[`] ↠temp 12: end if 13: else . 3 or more elements 14: size ↠u ⒠` + 1 15: twothirds ↠d(2 ◠size)/3e 16: g-sort-recurse(a, `, ` + twothirds ⒠1) 17: g-sort-recurse(a, u ⒠twothirds + 1, u) 18: g-sort-recurse(a, `, ` + twothirds ⒠1) 19: end if 20: end function first (5 pts), prove that the algorithm correctly sorts the numbers in the array (in increasing order). after showing that it correctly sorts 1 and 2 element intervals, you may make the (incorrect) assumption that the number of elements being passed to g-sort-recurse is always a multiple of 3 to simplify the notation (and drop the floors/ceilings).
Answers: 3
question
Computers and Technology, 22.06.2019 02:50
Which of the following had the greatest influence on opening the internet to the generly public
Answers: 1
question
Computers and Technology, 22.06.2019 03:30
Which group on the home tab allows you to add shapes to a powerpoint slide?
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
How to do this programming flowchart?
Answers: 3
You know the right answer?
A. Carly’s Catering provides meals for parties and special events. In Chapter 3, you created an Even...
Questions
Questions on the website: 13722363