Question

COP2860 - Introduction to C# Programming Module #5 Assignment 10 points Program Functionality: Create a C#.NET program that cCustomer Bill - 0x Bobs Burgers cheese fried egg bacon avocado Add 2.99 Orare medium wel done fries? O yes no payment? 14 O

Add-on prices: Base burger price 4.99 Cheese .99 Fried egg 1.99 Bacon 1.99 Avocado Fries 2.99 Cash discount • No tax because

0 0
Add a comment Improve this question Transcribed image text
Answer #1

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] :

- Customer Bill - O x Bobs Burgers cheese fried egg bacon avocado Orare O medium well done fries? O yes no payment? O cash O

*******************************

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

- Customer Bill - O x Bobs Burgers cheese fried egg bacon avocado Orare O medium well done fries? O yes no payment? O cash O

Screen 2:Screen showing total with 10% of discount

. Customer Bill - O X Bobs Burgers cheese fried egg bacon avocado Orare medium well done fries? O yes no payment? O cash O c

Screen 3:Screen showing total without discount

. Customer Bill - O X Bobs Burgers cheese fried egg bacon avocado Orare medium well done fries? yes Ono payment? O cash cred

NOTE :PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
COP2860 - Introduction to C# Programming Module #5 Assignment 10 points Program Functionality: Create a C#.NET...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT