This function will be called from the main program and when


Write a program that includes a function PICNIC() that will accept a floating-point number TOTAL and the addresses of the interger variables HOTDOGS, HAMBURGERS,SALAD,PICKLES. The passed floating-point number represents the TOTAL amount of money to be spent on food. The function is to determine the quantity of HOTDOGS, HAMBURGERS,SALAD,PICKLES that can be purchaced, writing these values directly into the respective variables declared in the calling function.

This function will be called from the main program and when it returns to main, it will print out the values of HOTDOGS, HAMBURGERS,SALAD,PICKLES.

Our favorite foods are in this order:

1- hotdogs 1.00$ each

2- hamburgers .50$ each

3- salad .25$ each

4- pickles .01$ each

Example: if I enter the total amount of money of 3.78$, i can bring the following items to my picnic: 3 hotdogs, 1 hamburger, 1 salad, 3 pickles.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: This function will be called from the main program and when
Reference No:- TGS01261913

Now Priced at $20 (50% Discount)

Recommended (91%)

Rated (4.3/5)