Question

In: Computer Science

Using C#: Create a Form that consists of 4 checkboxes, three radio buttons, a label and...

Using C#: Create a Form that consists of 4 checkboxes, three radio buttons, a label and a button. The 4 checkboxes represent pizza toppings. The three radiobuttons should represent three sizes of pizza, namely “small”, “medium” and “large”. When the user clicks the button you need to calculate the price of the pizza. The calculation should be done as follows: count up the cost of the selected ingredients (you may assign your own prices for the ingredients) and then multiply this cost with 1 for a medium, 0.5 for a small and 2 for a large. Display the calculated price in the label.

Solutions

Expert Solution

Code

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 Pizza_Ordering
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnPlaceOrder_Click(object sender, EventArgs e)
{
double totalCost = 0;
if (chkCheez.Checked == true)
{

totalCost += 2.5;
}

if (chkPaper.Checked == true)
{
totalCost += 5.0;
}
if (chkBeacon.Checked == true)
{
totalCost += 2;
}
if (chkBlackBeacon.Checked == true)
{
totalCost += 7.5;
}

if (rdSmall.Checked == true)
{
totalCost *= 0.5;
}
else if (rdMedium.Checked == true)
{
totalCost *= 1;
}
else
{
totalCost *= 2;
}
lblCost.Text = totalCost.ToString("C");
}
}
}
design

outputs

If you have any query regarding the code please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.


Related Solutions

Using C#: Create a Form that consists of a PictureBox and 3 radio buttons. Assign an...
Using C#: Create a Form that consists of a PictureBox and 3 radio buttons. Assign an image of your choice to the PictureBox. Each radio button should be associated with a specific PictureBox size mode. When the user clicks on a specific radio button, the PictureBox's size mode should be changed to reflect the selection.
Write an application with three radio buttons labeled “Cyan”, “Magenta”, and “Orange” that changes the background...
Write an application with three radio buttons labeled “Cyan”, “Magenta”, and “Orange” that changes the background color of a panel in the center of the frame to CYAN, MAGENTA, or ORANGE. This is required to be programmed in Java.
Create a Java Swing form that will have two Buttons: (1) the first linked to an...
Create a Java Swing form that will have two Buttons: (1) the first linked to an event handler to write data from two TextFields on the form to an output file; and (2) the other with an event handler to read data from the same file as input and write output to a binary ObjectOutputStream file.
b. An investor wants to create a portfolio of three stocks form a set that consists...
b. An investor wants to create a portfolio of three stocks form a set that consists of 5 defense companies, 4 transportation companies and 6 healthcare companies. If the investor picks the three stocks at random, what is the probability that all three stocks will be from different industries. c. In part (b), what is the probability that at least two out of the three stocks picked will be from different industries?
Create a C++ program that consists of the following: In maincreate the following three variables:...
Create a C++ program that consists of the following: In main create the following three variables: A char named theChar A double named theDouble An int named theInt Fill each of these variables with data taken as input from the keyboard using a single cin statement. Perform the following task on each variable: Increment theChar by one Decrement theDouble by two Square theInt This should be done on separate lines. Output the value of each variable to the screen on...
PYTHON PROGRAMMING Using tktinker, create a gui that surrounds the code below that has buttons and...
PYTHON PROGRAMMING Using tktinker, create a gui that surrounds the code below that has buttons and labels and an overall theme. # Meet the chatbot Eve print('Hi there! Welcome to the ChatBot station. I am going to ask you a series of questions and all you have to do is answer!') print(' ') print('Lets get started') #begin questions firstName = input('What is your first name?: ') lastName = input('What is your last name? ') print("Hi there, ", firstName + lastName,...
Using C# Windows App Form Create a simple calculator using +,-,*,/ Please show code GUI Code...
Using C# Windows App Form Create a simple calculator using +,-,*,/ Please show code GUI Code for calculator menus radio button input text boxes
using xsd, Create a number guessing game You would need an input box and buttons Ask...
using xsd, Create a number guessing game You would need an input box and buttons Ask the user for a number Produce a random number from 1-50 Do the comparison ​a. Make sure to provide hints back to the user if the number enter is low or high ​​-this element should be automatically added ​b. Clear the value enter in the text ​c. Give them 3 tries Whether the user wins or loses, display all the guesses along with the...
using xml, Create a number guessing game You would need an input box and buttons Ask...
using xml, Create a number guessing game You would need an input box and buttons Ask the user for a number Produce a random number from 1-50 Do the comparison             a. Make sure to provide hints back to the user if the number enter is low or high                         -this element should be automatically added             b. Clear the value enter in the text             c. Give them 3 tries Whether the user wins or loses, display all the...
Summarize three advantages and three disadvantages of using radio advertising and three advantages and three disadvantages...
Summarize three advantages and three disadvantages of using radio advertising and three advantages and three disadvantages of advertising on TV. Present three recommendations that you would make to an entrepreneur who is interested in considering TV or radio to advertise a product or service.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT