Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here is my problem, please use visual studio c# AND PLEASE POST THE FORM AS WELL: This program will be used to order a pizza.

Here is my problem, please use visual studio c# AND PLEASE POST THE FORM AS WELL:

"This program will be used to order a pizza. The user will make selections from the form to specify what kind of pizza she wants. The program will calculate the price of the order based on these choices. The price of the order and the message Is this what you want? is displayed in a message box when the user clicks a button submit the order. The message box has Yes and No buttons. If the user clicks the Yes button on the message box, then the controls are reset to the default values and another message box is displayed saying Thank you for your order (with just the OK button). If the No button is clicked, nothing is changed and the user may correct the order.

The form will have a set of radio buttons to select the size of the pizza. The sizes will be Small ($7.00), Medium ($13.00) and Large ($16.50). The default will be Small. The form will also have a set of radio buttons that select the type of crust. The choices are Thin (No extra charge), Thick ($1.00 extra) and Pan ($1.50).

The form will have a set of check boxes to select side orders. The side orders are Cheese Bread, Salad, and Fried Cheese Sticks. Each of the side orders is $1.00. The default is false for each side order.

There is a set of check boxes for toppings. They are Bacon, Black Olives, Green Olives, Green Peppers, Hamburger, Mushrooms, Onions and Sausage. The user may select any one of these by clicking on the item. The user may remove an item from the order by clicking on the item again. Each item costs $0.50. If you wish to use a checkboxList instead of a set of check boxes, you may do so.

There will be a text box to select the number of drinks. Each drink is $1.00. The default value is 0. The program should check to make sure that the value in the text box is numeric and if it is not numeric when the user clicks the Order In button then assume that the number of drinks is 0.

There is a button with the caption Order In. When this is pressed, show the message box that was described at the start of this assignment. After the user clicks OK the form is reset to the default values. We will ignore the problem of transmitting this order to the kitchen.

There is one more button which says About us. When this is clicked, a message box will appear saying that all ingredients are fresh when the pizza is delivered and if you have any questions about the amount of fat, salt, or calories in the pizza then you probably should not order one.

Here is the code i have so far:

namespace Project3 { public partial class Form1 : Form {

double total = 0.00; string msg = "" ; public Form1() { InitializeComponent(); }

private void radioButton5_CheckedChanged(object sender, EventArgs e) {

}

private void Form1_Load(object sender, EventArgs e) { int value = 0; txtNumberDrinks.Text = value.ToString(); }

private void checkBox1_CheckedChanged(object sender, EventArgs e) {

}

private void checkBox2_CheckedChanged(object sender, EventArgs e) {

}

private void checkBox3_CheckedChanged(object sender, EventArgs e) {

}

private void checkBox4_CheckedChanged(object sender, EventArgs e) {

}

private void checkBox5_CheckedChanged(object sender, EventArgs e) {

}

private void checkBox6_CheckedChanged(object sender, EventArgs e) {

}

private void checkBox7_CheckedChanged(object sender, EventArgs e) {

}

private void checkBox8_CheckedChanged(object sender, EventArgs e) {

}

private void btnOrder_Click(object sender, EventArgs e) { double toppingsAmt = 0; double sideAmt = 0;

//if statements for sizes if (rdoSmall.Checked) { total += 7.00; msg += "Small Size Selected "; }

else if (rdoMedium.Checked) { total += 13.00; msg += "Medium Size Selected "; }

else if (rdoLarge.Checked) { total += 16.50; msg += "Large Size Selected "; }

// if statements for crust

if (rdoThin.Checked) { msg += "Thin Crust Selected "; }

else if (rdoThick.Checked) { msg += "Thick Crust Selected "; }

else if (rdoPanCrust.Checked) { total += 1.50; msg += "Pan Crust Selected "; }

// if statements for sides

if (chkCheeseBread.Checked) { sideAmt += 1; msg += "Cheese Bread Side Selected "; }

if (chkSalad.Checked) { sideAmt += 1; msg += "Salad Side Selected "; }

if (chkFriedCheeseSticks.Checked) { sideAmt += 1; msg += "Fried Cheese Sticks Side Selected "; }

// Calculates Side amount and adds to total total += (sideAmt * 1.00);

// if statements for toppings

if (chkBacon.Checked) { toppingsAmt += 1; msg += "Bacon Topping Selected "; }

if (chkBlackOlives.Checked) { toppingsAmt += 1; msg += "Black Olives Topping Selected "; }

if (chkGreenOlives.Checked) { toppingsAmt += 1; msg += "Green Olives Topping Selected "; }

if (chkGreenPeppers.Checked) { toppingsAmt += 1; msg += "Green Peppers Topping Selected "; }

if (chkHamburger.Checked) { toppingsAmt += 1; msg += "Hamburger Topping Selected "; }

if (chkMushrooms.Checked) { toppingsAmt += 1; msg += "Mushrooms Topping Selected "; }

if (chkSausage.Checked) { toppingsAmt += 1; msg += "Sausage Topping Selected "; }

// calculate toppings amount to total total += (toppingsAmt * .50);

int val = 0; if (int.TryParse(txtNumberDrinks.Text, out val)) { if (val > 0) {

total += (val * 1.00); msg += "Selected Amount of Drinks" + val + " ";

} }

else { val = 0; total += (val * 1.00); msg += "Selected Amount of Drinks" + val + " "; }

string price = "Your Order Is =" + total.ToString(); MessageBoxButtons btn = MessageBoxButtons.YesNo;

DialogResult dlg = MessageBox.Show(msg, price, btn);

if (dlg == DialogResult.Yes)

{

MessageBox.Show("Thank you for your order");

rdoSmall.Checked = true;

rdoMedium.Checked = false;

rdoLarge.Checked = false;

rdoThin.Checked = true;

rdoThick.Checked = false;

rdoPanCrust.Checked = false;

chkBacon.Checked = false;

chkBlackOlives.Checked = false;

chkGreenOlives.Checked = false;

chkHamburger.Checked = false;

chkMushrooms.Checked = false;

chkOnions.Checked = false;

chkGreenPeppers.Checked = false;

chkSalad.Checked = false;

chkSausage.Checked = false;

chkCheeseBread.Checked = false;

chkFriedCheeseSticks.Checked = false;

total = 0;

msg = ""; }

}

private void btnAboutUs_Click(object sender, EventArgs e) { string msg = "All ingredients are fresh when the pizza is delivered. if you have any questions about the amount of fat, salt, or calories in the pizza then you probably should not order one.";

MessageBox.Show(msg, "About Us"); } } }

Here is what i have for my form:

image text in transcribed

Make any adjustments as needed and let me know if there needs to be any additions or changes to the Form. Thank you!

Form1.cs Form1.cs [Design] x Form1 Size Crust Sides Topping Cheese Bread Salad Fried Cheese Sticks Bacon O Small O Mediurm O Large O Thin ( Thick O Pan Crust Black Olives Green Olves Green Peppers v Number of Drinks Order In About Us Output Show output from

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions