Caterer Company
Local Caterer?s Company operates a small catering service.
They ask you to write an application for them to schedule their catering events. They mostly cater special events, but they occasionally cater corporate, private and nonprofit events as well. All catered events have an event minimum rate shown below:
Event Type Event Minimum Rate Manager
Corporate $500.00 Dave
Private $300.00 Dave
Nonprofit $150.00 Veronica
Special $200.00 Veronica
Write a program for Local Caterer?s Company that contains a class that has two methods for the event minimum rate and event type. Write a test program that accepts the user?s input and checks the event type input for errors until a valid event type is entered. After a valid input type is entered, the program displays the manager?s name for that event, the type of the event chosen, and the minimum rate to be charged.
View Answers
March 23, 2010 at 10:54 AM
Hi Friend,
In the following data,you haven't mention Event type.
Event Type Event Minimum Rate Manager
Corporate $500.00 Dave
Private $300.00 Dave
Nonprofit $150.00 Veronica
Special $200.00 Veronica
Please provide the Event Type also.
Thanks
March 23, 2010 at 7:43 PM
Event types are Corporate, private, non-profit and special
March 24, 2010 at 3:42 PM
Hi Friend,
Try the following code:
import java.io.*;
import java.util.*;
class Events{
public String type;
public String rate;
public String manager;
public Events(){}
public Events(String type,String rate,String manager) {
this.type = type;
this.rate = rate;
this.manager=manager;
}
public String getType() {
return type;
}
public String getRate() {
return rate;
}
public String getManager() {
return manager;
}
}
public class CateringEvent {
public static void main(String[] args) throws Exception {
System.out.println();
System.out.println("******Catering Services******");
System.out.println();
System.out.println("*****Event Types*****");
System.out.println();
System.out.println("1 Corporate");
System.out.println("2 Private");
System.out.println("3 Nonprofit");
System.out.println("4 Special");
List<Events> list = new ArrayList<Events>();
list.add(new Events("Corporate", "$500.00","Dave"));
list.add(new Events("Private", "$300.00","Dave"));
list.add(new Events("Nonprofit", "$150.00","Veronica"));
list.add(new Events("Special", "$200.00","Veronica"));
System.out.println(" ");
Scanner input=new Scanner(System.in);
System.out.print("Enter Event Type: ");
String eventType= input.next();
String arr[]={"Corporate","Private","Nonprofit","Special"};
while(!eventType.equals(arr[0])&&!eventType.equals(arr[1])&&!eventType.equals(arr[2])&&!eventType.equals(arr[3])){
System.out.print("Re Enter Event Type: ");
eventType= input.next();
}
for (Events s : list){
if(eventType.equals(s.getType())){
System.out.println("Event Type: "+s.getType());
System.out.println("Event Minimum Rate: "+s.getRate());
System.out.println("Manager: "+s.getManager());
}
}
}
}
Thanks
Related Tutorials/Questions & Answers:
Caterer Company - Java BeginnersCaterer Company Local
Caterer?s
Company operates a small catering service.
They ask you to write an application for them to schedule... Veronica
Write a program for Local
Caterer?s
Company that contains a class
Advertisements
ModuleNotFoundError: No module named 'company'ModuleNotFoundError: No module named '
company' Hi,
My Python... '
company'
How to remove the ModuleNotFoundError: No module named '
company... to install padas library.
You can install
company python with following command
ModuleNotFoundError: No module named 'company'ModuleNotFoundError: No module named '
company' Hi,
My Python... '
company'
How to remove the ModuleNotFoundError: No module named '
company... to install padas library.
You can install
company python with following command
ModuleNotFoundError: No module named 'company'ModuleNotFoundError: No module named '
company' Hi,
My Python... '
company'
How to remove the ModuleNotFoundError: No module named '
company... to install padas library.
You can install
company python with following command
ModuleNotFoundError: No module named 'company'ModuleNotFoundError: No module named '
company' Hi,
My Python... '
company'
How to remove the ModuleNotFoundError: No module named '
company... to install padas library.
You can install
company python with following command
run project on company lanrun project on
company lan sir, i have create dynamic java project of complaint registration and run on local host http://localhost:8080 and by using ip adress but the problem is how to run it at on
company server so
Android app development company app development
company in India?
Thanks
Hi,
Rose India is into development of Android and iOS mobile applications in India.
Company develops... development
company in India - iOS, Android and Cross platform application development
Best Company in Hyderbad - JDBCBest
Company in Hyderbad Access Infotech
Best for beginners Access Infotech Pvt. Ltd. Unit 5B, 4th Floor, Topaz Building, Punjagutta, Hyderabad-500082 Phone No : 040 30584310/11/12 Fax No : 040 30584315
Is Apple a dying company?Is Apple a dying
company? Hi,
I am beginner in Data Science... a dying
company?
Try to provide me good examples or tutorials links so that I can learn the
topic "Is Apple a dying
company?". Also tell me which
iPhone Development CompanyiPhone Development
Company
Roseindia Technologies Pvt Ltd, an emerging iPhone Development
Company in India is working on some groundbreaking iPhone software and web apps like Chess, Poker, Ridicules, Puzzles, Number game, Word search
logo of the music company, logo
How to design a logo of the music
company
... their
identity. The logo which we are going to make is of the music
company. You... to make a music
company logo. keep on following this example
until the end
Write a GUI application for the WebBuy Company Write a GUI application for the WebBuy
Company Write a GUI application for the WebBuy
Company that allows a user to compose the three parts of a complete email message: the ΓΆβ?¬Ε?To:ΓΆβ?¬Β?, ΓΆβ?¬Ε?Subject:ΓΆβ?¬Β? and ΓΆβ?¬Ε
Which is the best company for mobile app development?Which is the best
company for mobile app development? Hi,
Trying for find a best
company in India for developing application for my
company... have good look and feel.
Which is the best
company for mobile app development