At the risk of doing it all for you, I'll get you started as you've pretty much got the Math figured out now.
Code:
private void PicCalculate_Click(object sender, EventArgs e)
{
// Gross total
double total = 0;
// Hamburgers
this.AddToTotal(ref total, 1, 0);
// Double Cheeseburger
this.AddToTotal(ref total, 1.59, 7);
// McChicken
this.AddToTotal(ref total, 1.29, 0);
// Cheeseburger
this.AddToTotal(ref total, 1.19, 0);
// And so on.........
// Find out tax
double tax_payable = this.GetTax(total, 0.13);
// Net total rounding off anything over 2 decimal places
double net_total = Math.Round((total + tax_payable), 2);
// Find out how much the customer has given you
double money_given = 20; // let's say $20 for example
// find out how much change is due
double change_required = this.ChangeRequired(money_given, net_total);
MessageBox.Show("Amount due (pre tax): " + this.ValueToMoneyString(total) +
"\r\nTax due: " + this.ValueToMoneyString(tax_payable) +
"\r\nAmount due (post tax): " + this.ValueToMoneyString(net_total) +
"\r\nMoney given: " + this.ValueToMoneyString(money_given) +
"\r\nChange given: " + this.ValueToMoneyString(change_required));
}
private void AddToTotal(ref double total, double item_price, double item_quantity)
{
total += (item_price * item_quantity);
}
private double ChangeRequired(double money_given, double money_required)
{
return money_given - money_required;
}
private double GetTax(double total, double tax_rate)
{
return total * tax_rate;
}
private String ValueToMoneyString(double value)
{
// display value in a 0.00 format
return String.Format("{0:0.00}", value);
}
In this example I have ordered 7 double cheeseburgers.