Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

>> REGISTER NOW TO START POSTING

1. ## HELPP!!!!!!!

An array meals contains five elements corresponding to the meal codes 0 through 4 in Lab 6.2. For example, element meals[ 1 ] contains the number of "Chicken-based adult" meals requested, meals[ 4 ] contains the number of "Burger child" meals, and so on. Element meals[ 0 ] contains the number of requests in which none of the conditions for a particular meal type was met.

Write code to store in the double cost the cost to the airline of providing the meals, where the cost for a meal of each type is specified in the table below. The number of meals in meals[ 0 ] should be split equally between "Chicken-based adult" and "Beef-based adult". If this number is not an even number, then the number allocated to "Chicken-based adult" should be one more than the number allocated to "Beef-based adult".
Meal Code Meal Cost
1 \$1.75
2 \$2.08
3 \$2.14
4 \$0.98
int[] meals = { };
double cost;

2. ## Re: HELPP!!!!!!!

Welcome to the forums. There's no reason to shout. You should first start off by answering the following question: What have you tried?