Case Problem 1 - In previous chapters, you developed classes that work with catering event information for Carly’s Catering. Now modify the Event and EventDemo classes as follows: Modify the Event class to include an integer field that holds an event type. Add a final String array that holds names of the types of events that Carly’s caters—wedding, baptism, birthday, corporate, and other. Include get and set methods for the integer event type field. If the argument passed to the method that sets the event type is larger than the size of the array of String event types, then set the integer to the element number occupied by other. Include a get method that returns an event’s String event type based on the numeric event type. To keep the EventDemo class simple, remove all the statements that compare event sizes and that display the invitation Strings. Modify the EventDemo class so that instead of creating three single Event objects, it uses an array of three Event objects. Get data for each of the objects, and then display all the details for each object. Save the files as Event.java and EventDemo.java.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 2CP
icon
Related questions
Question
  1. Case Problem 1 - 

    In previous chapters, you developed classes that work with catering event information for Carly’s Catering. Now modify the Event and EventDemo classes as follows:

    Modify the Event class to include an integer field that holds an event type. Add a final String array that holds names of the types of events that Carly’s caters—wedding, baptism, birthday, corporate, and other. Include get and set methods for the integer event type field. If the argument passed to the method that sets the event type is larger than the size of the array of String event types, then set the integer to the element number occupied by other. Include a get method that returns an event’s String event type based on the numeric event type.

    To keep the EventDemo class simple, remove all the statements that compare event sizes and that display the invitation Strings.

    Modify the EventDemo class so that instead of creating three single Event objects, it uses an array of three Event objects. Get data for each of the objects, and then display all the details for each object.

    Save the files as Event.java and EventDemo.java.

 

View Rubric
 
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps

Blurred answer
Knowledge Booster
Program on Numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage