Well, here is some advice in your choosesize() function. You are using the variables: smallcoffee, mediumcoffee, and largecoffee, even though you never declared them. And the char
Size was declared in a seperate function, so technically, it doesn't exist in the choosesize() function. One way to fix that is to use parameters.
When you prototype your
choosesize() function at the top, add parameters in the parentheses, like so:
1 2
|
void choosesize(double smallCoffeePrice, double mediumCoffeePrice,
double largeCoffeePrice);
|
Then, change the function at the bottom when you write it.
Now, in your main function, you will want to get some variables (3, to be exact.). Set the variables as the prices of each size coffee, like so:
1 2 3
|
double smallCoffee = 1.75;
double mediumCoffee = 1.90;
double largeCoffee = 2.00;
|
Now, when you use your chooseSize() function, incorporate those variables into the parameters, like this:
1 2 3 4 5
|
//in main() function
//the menu
choosesize(smallCoffee, mediumCoffee, largeCoffee);
|
That should work for you. Glad to help and good luck!