Purchase Solution

C+ programing

Not what you're looking for?

Ask Custom Question

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.

Purchase this Solution

Solution Summary

C+ programing is modeled.

Solution Preview

In this type of program, use of weights to clearly state which item is favored much makes the program more versatile. For example, if I have $0.75, then I may buy 1 hamburger and 1 ...

Purchase this Solution

Free BrainMass Quizzes
Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

C# variables and classes

This quiz contains questions about C# classes and variables.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.