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.
Please complete in C# and use radio buttons on the form for the selections. Thank you!...
Please complete in C# and use radio buttons on the form for the selections. Thank you! For this assignment, you will be creating a Dorm and Meal Plan Calculator. A university has the following dormitories: Allen Hall $1,500 per semester Pike Hall $1,600 per semester Farthing Hall $1,800 per semester University Suites $2,500 per semester The university also offers the following meal plans: 7 meals per week $ 600 per semester 14 meals per week $1,200 per semester Unlimited meals...
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.
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 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.
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...
Using Android Studio, create a one java android app that has 4 buttons:- Change Color Button...
Using Android Studio, create a one java android app that has 4 buttons:- Change Color Button - When the Change Color button is clicked, it changes the current activity background to a randomly selected color Speak Button - When the Speak button is clicked, it opens a new activity named SpeakActivity. On the SpeakActivity there are three controls: EditText, Button (Speak) and Button (Back). The Speak button uses the Text to Speech service to say the text entered in EditText....
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,...
On Android Studio, create a 4 function calculator. The only buttons you need are 0-9, *,...
On Android Studio, create a 4 function calculator. The only buttons you need are 0-9, *, /, +, -, a clear, and enter button. Use StringTokenizer or String.split for the calculator code.
On Android Studio, create a 4 function calculator. The only buttons you need are 0-9, *,...
On Android Studio, create a 4 function calculator. The only buttons you need are 0-9, *, /, +, -, a clear, and enter button. Having this java code below, I need the XML code that organizes the layout of the calculator (using either linearLayout or relativeLayout). As shown in the JAVA Code - Button button0, button1, button2, button3, button4, button5, button6, button7, button8, button9, buttonadd, buttonsubtract, buttonmultiply, buttondivide, buttonequals, buttonclear and TextView display - is what is needed in the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT