Advertisement
Kenkaster001

HOA5

Sep 7th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace HOA5_12Eva03AmadorJM
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. private void TextBox1_TextChanged(object sender, EventArgs e)
  21. {
  22.  
  23. }
  24.  
  25. private void Button1_Click(object sender, EventArgs e)
  26. {
  27. int q1 = 0, q2 = 0, q3 = 0, total_bill = 0;
  28. string output = "";
  29. if (checkBox1.Checked)
  30. {
  31. q1 = int.Parse(textBox1.Text);
  32. output += "Burger x" + q1 + " Php " + q1*50 + "\r\n";
  33. total_bill += (q1 * 50);
  34. }
  35.  
  36. if (checkBox2.Checked)
  37. {
  38. q2 = int.Parse(textBox2.Text);
  39. output += "Fries x" + q1 + " Php " + q1 * 30 + "\r\n";
  40. total_bill += (q1 * 30);
  41. }
  42.  
  43. if (checkBox3.Checked)
  44. {
  45. q3 = int.Parse(textBox3.Text);
  46. output += "Sundae x" + q1 + " Php " + q1 * 25 + "\r\n";
  47. total_bill += (q1 * 25);
  48. }
  49.  
  50. if (radioButton1.Checked)
  51. {
  52. output += "Drink: Small Php 10" + "\r\n";
  53. total_bill += 10;
  54. }
  55. else if (radioButton2.Checked)
  56. {
  57. output += "Drink: Medium Php 15" + "\r\n";
  58. total_bill += 15;
  59. }
  60. else if (radioButton2.Checked)
  61. {
  62. output += "Drink: Large Php 20" + "\r\n";
  63. total_bill += 20;
  64. }
  65.  
  66. output += "\r\n" + "Total Bill: Php " + total_bill + "\r\n" + "Thank you for dining with us!";
  67.  
  68. textBox4.Text = output;
  69.  
  70.  
  71. }
  72. }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement