Here's the sample run of the problem:
LUNCH ORDER
===========================
ORDER OF HAMBURGERS : 3
ORDER OF FRENCH FRIES : 0
ORDER OF SOFT DRINKS : 2
LUNCH BILL
===================================
ITEM COST QUANTITY
-----------------------------------
HAMBURGER 100.00 3
FRENCH FRIES 35.50 0
SOFT DRINK 12.50 2
Do you realise that at line 16, you read a value into bill, then at line 18 you overwrite it with a new value, and then at 20 you overwrite it again with a third value? So you're throwing away the first two values entered by the user, and then treating the third number as if it was the order for all three things?
For clarity and simplicity, since you're a beginner, you're going to want:
3 separate variables, to store the number of items of each type ordered by the customer. These should be int because you can only order whole numbers of items.
3 more variables, to store the total cost of each type of item. These should be float, as you're already using floating-point prices.
1 more variable to store the total cost of the bill. This will, obviously, be the sum of the totals for the 3 types of item. This should also be a float.
I would do that with use of loop and user input, you will have to integrate this with your code ;) I have hard coded values of the food and soft drinks. it would be good idea to create possibly functions for each menu entry. but this would require a bit more code :D
do you think is better to use float or double for this kind of problem?
I read somewhere that double is better then float, I think it was about precision???
It is not just about precision (or long double would be the default floating point type).
It is not for nothing that the a conversion from float to double is a promotion,
or that the type of a floating point literal without a type suffix eg. 2.3 is double,
or that functions like std::sqrt(), when invoked with an integral argument yield a result of type double