using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RestourantMenu
{
public partial class Form1 : Form
{
private float subtotal = 0;
private float tax = 0;
private float tips = 0;
private float total = 0;
private int peopleCount = 0;
private bool fifteenthPercentToTips = false;
public Form1()
{
InitializeComponent();
}
private void ButtonAddToBillTable_Click(object sender, EventArgs e)
{
if (treeViewFood.SelectedNode.Parent != null)
listBoxTableBill.Items.Add(treeViewFood.SelectedNode.Text);
}
private void ButtonClear_Click(object sender, EventArgs e)
{
textBoxSubtotal.Text = "0.00$";
textBoxTax.Text = "0.00$";
textBoxTips.Text = "0.00$";
textBoxTotal.Text = "0.00$";
}
private void ButtonEnterPeopleCount_Click(object sender, EventArgs e)
{
if (Int16.TryParse(textBoxPeopleCount.Text, out short n))
{
peopleCount = n;
if (peopleCount <= 6)
{
textBoxTipsCount.Enabled = true;
buttonTipsCount.Enabled = true;
}
else
fifteenthPercentToTips = true;
}
else
{
MessageBox.Show("Write correct number of people in party!");
textBoxTipsCount.Enabled = false;
buttonTipsCount.Enabled = false;
fifteenthPercentToTips = false;
}
}
private void ButtonTipsCount_Click(object sender, EventArgs e)
{
if (float.TryParse(textBoxTipsCount.Text.Replace('.',','), out float n))
{
tips = n;
textBoxTips.Text = tips.ToString("0.00") +"$";
}
else
MessageBox.Show("Write correct value of tips!");
}
}
}
Please submit your question as order to get the full Visual Studio project.
Comments
Dear David, If you have serious assignment that requires large amount of work and hence cannot be done for free you can submit it as assignment and our experts will surely assist you. Price depends on complexity of your assignments and deadline. Please submit your assignments to our control panel and you'll get price estimation. If you have further questions please feel free to ask them via info@assignmentexpert.com (our support department) or use live chat on this website.
I have asked a question already. Can someone send me the full code for this restaurant program? Id greatly appreciate it, thanks.
Leave a comment