- #1
denZer
- 17
- 0
Homework Statement
There is a user defined function that looks like this:
void DisplayMenu(char *item)
My problem is that I have no clue on how I could include "*item" in my function, without changing the name or algorithm. The purpose of this function to to display the list of apps available and to prompts for the user’s selection and to sets the value of the selection.
Homework Equations
Here is the whole equation:
void DisplayMenu(char *item)
{
double G;
double X;
double E;
double R;
double P;
double GamePackage=4.99;
double XRayApp=2.99;
double EBayAutobidder=7.99;
double RestaurantLocator=1.99;
double Photoeditor=3.99;
printf("HERE ARE THE SELECTION:\n");
printf("G -- GamePackage %.2lf\n",GamePackage);
printf("X -- X-Ray App %.2lf\n",XRayApp);
printf("E -- E-Bay Autobidder %.2lf\n",EBayAutobidder);
printf("R -- Restaurant Locator %.2lf\n",RestaurantLocator);
printf("P -- Photo editor %.2lf\n",Photoeditor);
return;
}
The Attempt at a Solution
The user must type in the letter of the selection, such as G, X, E, R, or P. I think this is where the char *item must be used, but how can I use it store what the user selects?
Any help is very much appreciated!