This is what I have written so far for my homework.
No, I am not asking for someone to do my homework just to help me with what I have so far. This is a Restaurant menu created for a web site, I am very close to getting it finished, just need help in getting out a few bugs. My course is in C# using Visual Studio
Thank you,
Wade
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
private double[] AppetizerCost = { 0.00, 5.95, 6.95, 8.95, 8.95, 10.95, 12.95, 6.95 };
private double[] MainCost = { 0.00, 15.95, 13.95, 13.95, 11.95, 19.95, 20.95, 18.95, 13.95, 14.95 };
private double[] DessertCost = { 0.00, 5.95, 3.95, 5.95, 4.95, 5.95 };
private double[] BeverageCost = { 0.00, 1.95, 1.50, 1.25, 2.95, 2.50, 1.50 };
protected void Page_Load(object sender, EventArgs e)
{
double cost = 0.00;
if (AppetizerDropDown.SelectedIndex != -1)
cost = AppetizerCost[AppetizerDropDown.SelectedIndex];
if (DropDownMain.SelectedIndex != -1)
cost += MainCost[DropDownMain.SelectedIndex];
if (DropDownDessert.SelectedIndex != -1)
cost += DessertCost[DropDownDessert.SelectedIndex];
if (DropDownBev.SelectedIndex != -1)
cost += BeverageCost[DropDownBev.SelectedIndex];
labelSubTotal.Text = String.Format("{0:C}", cost);
labelTax.Text = String.Format("{0:C}", cost * .07);
labelTotal.Text = String.Format("{0:C}", cost * 1.07);
}
protected void ButtonClear_Click(object sender, EventArgs e)
{
AppetizerDropDown.SelectedIndex = -1;
DropDownMain.SelectedIndex = -1;
DropDownDessert.SelectedIndex = -1;
DropDownBev.SelectedIndex = -1;
}
}