CODE:
#include <iostream>
#include<string>
#include<conio.h>
using namespace std;
int main(){
// declare a char to store the user choice
char user_choice;
do
{
// display the menu to the user
cout << "Hot Beverage Menu: \n" << endl;
cout << "A: Coffee $1.00 " << endl;
cout << "B: Tea $0.75" << endl;
cout << "C: Hot Chocolate $1.25" << endl;
cout << "D: Cappuccino $2.50" << endl;
cout << "E: Exit Menu \n" << endl;
// get the user choice
cout << "Enter your choice: ";
cin >> user_choice;
// declare an int to store the number of cups user want and a double to store the total bill
int num_cups;
double total;
// check the user choice and ask for number of cups and then calculate the total bill based on price
// if the user enter some invalid character then print Invalid option and re-prompt the user to enter an item from the menu.
// continue this menu based prompt until user enters E
if(user_choice == 'A')
{
cout << "How many cups of Coffee would you like? " ;
cin >> num_cups;
cout << "Total Bill: $" << num_cups*1 << endl;
}
else if(user_choice == 'B')
{
cout << "How many cups of Tea would you like? " ;
cin >> num_cups;
cout << "Total Bill: $" << num_cups*0.75 << endl;
}
else if(user_choice == 'C')
{
cout << "How many cups of Hot Chocoloate would you like? " ;
cin >> num_cups;
cout << "Total Bill: $" << num_cups*1.25 << endl;
}
else if(user_choice == 'D')
{
cout << "How many cups of Cappuccino would you like? " ;
cin >> num_cups;
cout << "Total Bill: $" << num_cups*2.5 << endl;
}
else if(user_choice == 'E')
{
cout << "Exiting the menu system" << endl;
}
else
{
cout << "Invalid choice" << endl;
}
cout << "\n\n" << endl;
} while(user_choice != 'E');
getch();
return 0;
}
The explanation is provided in form of comments within the code.
Write a program that displays this to the user. "Hot Beverage Menu" "A: Coffee $1.00", "B:...
Problem Statement: Chip’s Snack Bar sells chips ($1), soda ($1.25), hot dogs ($2) and coffee ($0.75). Both Seniors (i.e., age >= 62) and Students are eligible for a 10% discount. Seniors are not charged for coffee (regardless of the number ordered). All sales are taxed at a rate of 6%. Write a Java program to do the following: 1. Read in an order from the keyboard ( which contains the student status [y/n], user age, number of chips, number of...
SYNOPSIS The product manager for coffee development at Kraft Canada must decide whether to introduce the company's new line of single-serve coffee pods or to await results from the product's launch in the United States. Key strategic decisions include choosing the target market to focus on and determining the value proposition to emphasize. Important questions are also raised in regard to how the new product should be branded, the flavors to offer, whether Kraft should use traditional distribution channels or...