Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 HOA5_12Eva03AmadorJM
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void TextBox1_TextChanged(object sender, EventArgs e)
- {
- }
- private void Button1_Click(object sender, EventArgs e)
- {
- int q1 = 0, q2 = 0, q3 = 0, total_bill = 0;
- string output = "";
- if (checkBox1.Checked)
- {
- q1 = int.Parse(textBox1.Text);
- output += "Burger x" + q1 + " Php " + q1*50 + "\r\n";
- total_bill += (q1 * 50);
- }
- if (checkBox2.Checked)
- {
- q2 = int.Parse(textBox2.Text);
- output += "Fries x" + q1 + " Php " + q1 * 30 + "\r\n";
- total_bill += (q1 * 30);
- }
- if (checkBox3.Checked)
- {
- q3 = int.Parse(textBox3.Text);
- output += "Sundae x" + q1 + " Php " + q1 * 25 + "\r\n";
- total_bill += (q1 * 25);
- }
- if (radioButton1.Checked)
- {
- output += "Drink: Small Php 10" + "\r\n";
- total_bill += 10;
- }
- else if (radioButton2.Checked)
- {
- output += "Drink: Medium Php 15" + "\r\n";
- total_bill += 15;
- }
- else if (radioButton2.Checked)
- {
- output += "Drink: Large Php 20" + "\r\n";
- total_bill += 20;
- }
- output += "\r\n" + "Total Bill: Php " + total_bill + "\r\n" + "Thank you for dining with us!";
- textBox4.Text = output;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement