i really need help i don 39 t think i 39 m doing this right at all i 39 mcompletely 3604116

I really need help I don't think I'm doing this right at all. I'mcompletely lost on arrays. Here is what I have to do..

Riley Residence Hall charges different rates for semester room andboard based on the number of meals per day the student wants. Thesemester rate with no meals is $300.With one meal per day, therate is $450. With two meals per day, the rate is $520, and withthree meals per day, the rate is $590.

-Store these rates in an array.

-Write a program that allows a student to enter the number of mealsdesired per day.

-Output the semester room and board rate.

-Place the program in a loop where it will continue to processstudent rates until 9 is entered for the number of meals.

-Use the following input in the order given: 2, 0, 3, 1, 9

Here's what I have but I have a feeling i'm doing it wrong.

*Will rate Lifesaver*


void main ()


const int arraySize = 5;

int totalMeals[arraySize] = {2, 0, 3, 1, 9};

int rate[arraySize] = {$300, $450, $520, $590,$940};

int neededMeal;

int x;



for (x = 0; x

if (neededMeal == totalMeals[x])



"Get 15% discount on your first 3 orders with us"
Use the following coupon

Order Now