# Thread: The Vending machine dilemma! <3 Thanks ahead of time for the help.

1. ## The Vending machine dilemma! <3 Thanks ahead of time for the help.

Here is part of my code:

Code:
```char selection;
double item_cost;
double amount;
double owed;
double total;

printf("Deposit amount:%d");
scanf("%lg", &amount);

printf("Price of Item %c is %lg", &selection, &item_cost);

printf("Balanced entered:%lg", &amount);```
Here is the output I am trying to replicate:
Code:
```Please deposit your money by selection:
1-\$5.00
2-\$1.00
3-\$0.25
4-\$0.10
5-\$0.05

Deposit Amount: 1

------------------------------
Price of Item: k is \$1.00

Balance Entered: \$5.00```
--------------------------------------------------------------------------
I'm confused on how i get the 1/2/3/4/5 to equal the right price since the deposited amount is being represented by the selection and not the price.

2. try using a switch statement
Code:
```int choice;

printf("1");
and so on...

scanf("%d", &choice);

switch(choice)
{
case 1:
break;

case 2:
break;
}```
then you can write separate functions for each case....