using Visual Studio what is the form1.designer.cs code used for this type of form1.cs code: the salad ordering application in C# using Visual Studio: using System; using System.Windows.Forms; namespace SaladOrderingApplication { public partial class Form1 : Form { private double totalPrice = 0; private double lettucePrice = 2.5; private double tomatoPrice = 1.5; private double cucumberPrice = 2.0; private double carrotPrice = 1.0; private double ranchSourcePrice = 0.5; private double honeyMustardSourcePrice = 0.6; private double italianSourcePrice = 0.7; private double lowFatSourcePrice = 0.4; public Form1() { InitializeComponent(); } private void cbLettuce_CheckedChanged(object sender, EventArgs e) { if (cbLettuce.Checked) { totalPrice += lettucePrice; lbIngredients.Items.Add("Lettuce"); } else { totalPrice -= lettucePrice; lbIngredients.Items.Remove("Lettuce"); } } private void cbTomato_CheckedChanged(object sender, EventArgs e) { if (cbTomato.Checked) { totalPrice += tomatoPrice; lbIngredients.Items.Add("Tomato"); } else { totalPrice -= tomatoPrice; lbIngredients.Items.Remove("Tomato"); } } private void cbCucumber_CheckedChanged(object sender, EventArgs e) { if (cbCucumber.Checked) { totalPrice += cucumberPrice; lbIngredients.Items.Add("Cucumber"); } else { totalPrice -= cucumberPrice; lbIngredients.Items.Remove("Cucumber"); } } private void cbCarrot_CheckedChanged(object sender, EventArgs e) { if (cbCarrot.Checked) { totalPrice += carrotPrice; lbIngredients.Items.Add("Carrot"); } else { totalPrice -= carrotPrice; lbIngredients.Items.Remove("Carrot"); } } private void rbRanch_CheckedChanged(object sender, EventArgs e) { if (rbRanch.Checked) { totalPrice += ranchSourcePrice; lbSources.Items.Clear(); lbSources.Items.Add("Ranch"); } else { totalPrice -= ranchSourcePrice; lbSources.Items.Clear(); } } private void rbHoneyMustard_CheckedChanged(object sender, EventArgs e) { if (rbHoneyMustard.Checked) { totalPrice += honeyMustardSourcePrice; lbSources.Items.Clear(); lbSources.Items.Add("Honey Mustard"); } else { totalPrice -= honeyMustardSourcePrice; lbSources.Items.Clear(); } private void rbItalian_CheckedChanged(object sender, EventArgs e) { if (rbItalian.Checked) { totalPrice += italianSourcePrice; lbSources.Items.Clear(); lbSources.Items.Add("Italian"); } else { totalPrice -= italianSourcePrice; lbSources.Items.Clear(); } } private void rbLowFat_CheckedChanged(object sender, EventArgs e) { if (rbLowFat.Checked) { totalPrice += lowFatSourcePrice; lbSources.Items.Clear(); lbSources.Items.Add("Low Fat"); } else { totalPrice -= lowFatSourcePrice; lbSources.Items.Clear(); } } private void btnOrder_Click(object sender, EventArgs e) { lbIngredients.Items.Clear(); lbSources.Items.Clear(); cbLettuce.Checked = false; cbTomato.Checked = false; cbCucumber.Checked = false; cbCarrot.Checked = false; rbRanch.Checked = false; rbHoneyMustard.Checked = false; rbItalian.Checked = false; rbLowFat.Checked = false; totalPrice = 0; MessageBox.Show("Your order has been placed!"); } private void btnClear_Click(object sender, EventArgs e) { lbIngredients.Items.Clear(); lbSources.Items.Clear(); cbLettuce.Checked = false; cbTomato.Checked = false; cbCucumber.Checked = false; cbCarrot.Checked = false; rbRanch.Checked = false; rbHoneyMustard.Checked = false; rbItalian.Checked = false; rbLowFat.Checked = false; totalPrice = 0; } private void btnDisplay_Click(object sender, EventArgs e) { MessageBox.Show("Ingredients: " + Environment.NewLine + String.Join(Environment.NewLine, lbIngredients.Items) + Environment.NewLine + Environment.NewLine + "Source: " + Environment.NewLine + String.Join(Environment.NewLine, lbSources.Items) + Environment.NewLine + Environment.NewLine + "Total Price: $" + totalPrice); } private void exitToolStripMenuItem_Click(object sender, EventArgs e) { Application.Exit(); } } }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

using Visual Studio what is the form1.designer.cs code used for this type of form1.cs code:

the salad ordering application in C# using Visual Studio:

using System;
using System.Windows.Forms;

namespace SaladOrderingApplication
{
public partial class Form1 : Form
{
private double totalPrice = 0;
private double lettucePrice = 2.5;
private double tomatoPrice = 1.5;
private double cucumberPrice = 2.0;
private double carrotPrice = 1.0;
private double ranchSourcePrice = 0.5;
private double honeyMustardSourcePrice = 0.6;
private double italianSourcePrice = 0.7;
private double lowFatSourcePrice = 0.4;

public Form1()
{
InitializeComponent();
}

private void cbLettuce_CheckedChanged(object sender, EventArgs e)
{
if (cbLettuce.Checked)
{
totalPrice += lettucePrice;
lbIngredients.Items.Add("Lettuce");
}
else
{
totalPrice -= lettucePrice;
lbIngredients.Items.Remove("Lettuce");
}
}

private void cbTomato_CheckedChanged(object sender, EventArgs e)
{
if (cbTomato.Checked)
{
totalPrice += tomatoPrice;
lbIngredients.Items.Add("Tomato");
}
else
{
totalPrice -= tomatoPrice;
lbIngredients.Items.Remove("Tomato");
}
}

private void cbCucumber_CheckedChanged(object sender, EventArgs e)
{
if (cbCucumber.Checked)
{
totalPrice += cucumberPrice;
lbIngredients.Items.Add("Cucumber");
}
else
{
totalPrice -= cucumberPrice;
lbIngredients.Items.Remove("Cucumber");
}
}

private void cbCarrot_CheckedChanged(object sender, EventArgs e)
{
if (cbCarrot.Checked)
{
totalPrice += carrotPrice;
lbIngredients.Items.Add("Carrot");
}
else
{
totalPrice -= carrotPrice;
lbIngredients.Items.Remove("Carrot");
}
}

private void rbRanch_CheckedChanged(object sender, EventArgs e)
{
if (rbRanch.Checked)
{
totalPrice += ranchSourcePrice;
lbSources.Items.Clear();
lbSources.Items.Add("Ranch");
}
else
{
totalPrice -= ranchSourcePrice;
lbSources.Items.Clear();
}
}

private void rbHoneyMustard_CheckedChanged(object sender, EventArgs e)
{
if (rbHoneyMustard.Checked)
{
totalPrice += honeyMustardSourcePrice;
lbSources.Items.Clear();
lbSources.Items.Add("Honey Mustard");
}
else
{
totalPrice -= honeyMustardSourcePrice;
lbSources.Items.Clear();
}
private void rbItalian_CheckedChanged(object sender, EventArgs e)
{
if (rbItalian.Checked)
{
totalPrice += italianSourcePrice;
lbSources.Items.Clear();
lbSources.Items.Add("Italian");
}
else
{
totalPrice -= italianSourcePrice;
lbSources.Items.Clear();
}
}

private void rbLowFat_CheckedChanged(object sender, EventArgs e)
{
if (rbLowFat.Checked)
{
totalPrice += lowFatSourcePrice;
lbSources.Items.Clear();
lbSources.Items.Add("Low Fat");
}
else
{
totalPrice -= lowFatSourcePrice;
lbSources.Items.Clear();
}
}

private void btnOrder_Click(object sender, EventArgs e)
{
lbIngredients.Items.Clear();
lbSources.Items.Clear();
cbLettuce.Checked = false;
cbTomato.Checked = false;
cbCucumber.Checked = false;
cbCarrot.Checked = false;
rbRanch.Checked = false;
rbHoneyMustard.Checked = false;
rbItalian.Checked = false;
rbLowFat.Checked = false;
totalPrice = 0;
MessageBox.Show("Your order has been placed!");
}

private void btnClear_Click(object sender, EventArgs e)
{
lbIngredients.Items.Clear();
lbSources.Items.Clear();
cbLettuce.Checked = false;
cbTomato.Checked = false;
cbCucumber.Checked = false;
cbCarrot.Checked = false;
rbRanch.Checked = false;
rbHoneyMustard.Checked = false;
rbItalian.Checked = false;
rbLowFat.Checked = false;
totalPrice = 0;
}

private void btnDisplay_Click(object sender, EventArgs e)
{
MessageBox.Show("Ingredients: " + Environment.NewLine + String.Join(Environment.NewLine, lbIngredients.Items) +
Environment.NewLine + Environment.NewLine + "Source: " + Environment.NewLine + String.Join(Environment.NewLine, lbSources.Items) +
Environment.NewLine + Environment.NewLine + "Total Price: $" + totalPrice);
}

private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Running Time of Application
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education