Dear Student ,
As per requirement submitted above kindly find below solution.
Here new windows forms application in C# is created using visual studio 2019 with name "CustomerBillApp". This application contains a form with name "Form.cs".Below is the details of this form.
Form1.cs[Design] :
*******************************
Form1.cs :
//namespace
using System;
using System.Windows.Forms;
//application namespace
namespace CustomerBillApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//total button click
private void btnTotal_Click(object sender, EventArgs e)
{
//declaring variable to store base burger price
double baseBurgerPrice = 4.99;
double burgerPrice = 0;//declaring variable to store price
double addOn = 0;//declaring variable to store add on price
double friesPrice = 0;//declaring variable to store fries
price
double discountPercent = 0; //declaring variable to store discount
percent
//checking which burger is selected
if(chkCheese.Checked==true)
{
//if cheese burger is selected then
addOn += 0.99;
}
if (chkfriedegg.Checked == true)
{
//if fried egg is selected then
addOn+= 1.99;
}
if(chkBacon.Checked == true)
{
//if bacon is selected then
addOn += 1.99;
}
if (chkAvocado.Checked == true)
{
//if avocado is selected then
addOn += 0.99;
}
//checking whether fries is selected
if(rbtYes.Checked==true)
{
//if fries is selected then
friesPrice = 2.99;
}
//checking payment method
if(rbtCash.Checked==true)
{
//if cash is selected then
//give 10% discount
discountPercent = 0.10;
}
//find total amount
burgerPrice = baseBurgerPrice + addOn + friesPrice;
//calculate discount
double total = burgerPrice - burgerPrice * discountPercent;
//display total in the textbox
txtTotal.Text = total.ToString("0.00");
}
//clear button click
private void btnClear_Click(object sender, EventArgs e)
{
//clear textbox and all selections
txtTotal.Text = "";
chkCheese.Checked = false;
chkBacon.Checked = false;
chkfriedegg.Checked = false;
chkAvocado.Checked = false;
rbtCash.Checked = false;
rbtCredit.Checked = false;
rbtYes.Checked = false;
rbtNo.Checked = false;
rbtMedium.Checked = false;
rbtRare.Checked = false;
rbtWelldone.Checked = false;
}
}
}
==================================
Output :Run application using F5 and will get the screen as shown below
Screen 1:Form1.cs
Screen 2:Screen showing total with 10% of discount
Screen 3:Screen showing total without discount
NOTE :PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.
COP2860 - Introduction to C# Programming Module #5 Assignment 10 points Program Functionality: Create a C#.NET...