Modify the method that sets the number of guests

Assignment Help Basic Computer Science
Reference no: EM131547741

Question: Case Problem #1 Carly's Catering provides meals for parties and special events. In Chapters 3 and 4, you created an Event class for the company. Now, make the following changes to the class:

- Currently, the class contains a field that holds the price for an Event. Now add another field that holds the price per guest, and add a public method to return its value.

- Currently, the class contains a constant for the price per guest. Replace that field with two fields-a lower price per guest that is $32, and a higher price per guest that is $35.

- Add a new method named isLargeEvent() that returns true if the number of guests is 50 or greater and otherwise returns false.

- Modify the method that sets the number of guests so that a large Event (over 50 guests) uses the lower price per guest to set the new pricePerGuest field and calculate the total Event price. A small Event uses the higher price.

- Save the file as Event.java

Reference no: EM131547741

Questions Cloud

Explains why americans vote for politicians and judges : State your hypothesis that explains why Americans vote for politicians and judges that make laws and decisions that have these results?
Aspects of healthcare educational experience : 1. What aspects of your healthcare educational experience have you found most helpful in preparing you for leadership in organizations?
Develop a strategy for human resource professionals : Develop a strategy for human resource professionals and IT professionals to work together. Does the paper address the question(s) or task(s)?
Dividend policy-calculate dividend payout and dividend yield : Calculate the dividend payout and dividend yield. Identify a dividend payout policy that the company follows.
Modify the method that sets the number of guests : Case Problem #1 Carly's Catering provides meals for parties and special events. In Chapters 3 and 4, you created an Event class for the company.
Reliable estimating procedure : "If these percentages are consistent over the past few years, then this is a reliable estimating procedure."
When does tripitaka pray and what for : When does Tripitaka pray and what for? What kinds of supernatural interventions do we see in this story?
What is the risk-neutral probability of positive outcome : A company is currently awaiting the outcome of a major lawsuit. What is the risk-neutral probability of a positive outcome?
Write recursive and string-valued method that accepts string : Write a recursive, string-valued method, replace, that accepts a string and returns a new string consisting of the original string with each blank replaced.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Determine the mass flow rate of air in the gas-turbine cycle

The gas-turbine cycle of a combined gas-steam power plant has a pressure ratio of 12. Air enters the compressor at 310 K and the turbine at 1400 K.

  Design your data and database administration functions

Design your data and database administration functions. Include their responsibilities and explain how they will add value to the corporation.

  Sequential logic structures

Document the steps for the logic structure to capture the payment information. This can be done as either a flowchart or pseudocode. Be sure to include inputs, variable declarations and assignments, and outputs.

  Verify the stability of the closed-loop system

Obtain the step response of the closed-loop system to verify the stability of the closed-loop system with actuator saturation.

  Why this type of switching was chosen for telephone networks

In Chapter 8, we discussed the three communication phases involved in a circuit-switched network. Match these phases with the phases in a telephone call between two parties.

  Evaluate the run time of the isvalidsource() function

Would it buy us anything to use a tail reference with the linked list structure used to implement the Stack ADT? Explain your answer.

  Explaining options to begin troubleshooting

Which two options should you use to begin troubleshooting?

  Find the transfer function of the simple amplification

Find the transfer function of the simple amplification circuit shown using this model.

  Dynamic model of aggregate demand and aggregate supply

Use the dynamic model of aggregate demand and aggregate supply to illustrate and explain a situation where the economy is growing but experiencing inflation.

  Compare this implementation to the version using sentinels

Make sure it produces correct output for input with 0, 1, 2, 3, and 4 words. Compare this implementation to the version using sentinels.

  Show that the problem of finding a maximal matching

Show that the problem of finding a maximal matching can be formulated as a max-flow problem.

  Write a program asks the user to enter a month

Write a program asks the user to enter a month (1 for January, 2 for February, and so on) and then prints the number of days in the month. For February, print "28 or 29 days". For example: Enter a mont: 5 30 days Do not use a separate if/else bran..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd