kominosmash 0 Newbie Poster

I'm having trouble trying to figure out how to code an output for the customer when they order a certain item for example:

customer orders a number 1 which is a double burger or a number 2 a heap of fried chicken, then they are prompted if they want fries and a drink. if they say yes to both their total is added with tax. I got that part down, but where I'm confused is how do I have it output their order...

example:

Your order is a double burger with fries and a drink
or
Your order is a heap of fried chicken with a drink

I want it to output what they ordered but I'm confused as to how to do it...any help would be greatly appreciated

here is my program code and I'm using visual studio 2010, and for some reason I keep getting this

unsuccessfulbuild" because "AlwaysCreate" was specified. is this some sort of bug in visual studio 2010.

#include<iostream>

using namespace std;

void welcome(int& orderNumber);
double takeOrder(int orderNumber);
double totalSale(double subtotal);

int main()
{
	int orderNumber;
	double subtotal, total;
	welcome(orderNumber);
	subtotal = takeOrder(orderNumber);
	total = totalSale(subtotal);


	cout<<"Your total is:"<<total<<endl;

system("pause");
return 0;

}
 void welcome(int& orderNumber)
{
	cout<<"Welcome to Large Joe's, can I take your order?";
	cout<<endl;
	cout<<"For a double burger, press 1:";
	cout<<endl;
	cout<<"For a heap of fried chicken, press 2:";
	cout<<endl;
	cin>>orderNumber;
	cout<<endl;
}
 double takeOrder(int orderNumber)
 {
    double subtotal = 0;
	char fries, drink;

	if (orderNumber == 1)
	{
		subtotal = subtotal + 4.99;
	}
	else if (orderNumber == 2)
	{
		subtotal = subtotal + 6.99;
	}

	cout<<"Would you like fries with your order? y/n:";
	cout<<endl;
	cin>>fries;
	cout<<endl;
	cout<<"Would you like a drink with your order? y/n:";
	cout<<endl;
	cin>>drink;
	cout<<endl;

	if (fries == 'y' || fries == 'Y')
		subtotal = subtotal + 2.99;
	if (drink == 'y' || drink == 'Y')
		subtotal = subtotal + 1.50;

	return subtotal;
}
 double totalSale(double subtotal)
 {
	 double total = 0;
	 const double salesTax = 0.0625;
	 total = subtotal + (salesTax * subtotal);

	 return total;
 }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.