0
How to code this ?
I want to convert item into double how to code it ? Example I sell pizza for 10.00 water for 1.00 and burger for 3.00. And I want to know what does the people want to buy. If they order coke, I will replace it with water. And print out their sum. They must order 2 item or more. Tax is 2%. Code : Int main(){ String order, order1; Double sum = 0.00; Double pizza = 10.00; Double water = 1.00; Double burger = 3.00; Cin >> order >> order1; // I don't what to code next.
1 Answer
0
My idea is that you can show the menu and let them choose by number. The next input could be amount of order for the selected menu.
Example (on screen)
Welcome! please place your order
and amount of order.
1. Pizza @ 10.00
2. Burger @ 3.00
3. Water @1.00
..... More menu items here .....
They can type (for example order 2 pizzas and 2 water)
1 2 <- 2 pizzas
3 2 <- 2 water
You can also make a cascade menu, main menu asks for which type of order (food or drink). And you can display foods menu or drinks menu once main menu is chosen.