My program is not working properly. I input a screenshot of the assignment and my form, the code that I have written is directly under this. Please tell me how to correct it, I am supposed to use...


My program is not working properly. I input a screenshot of the assignment and my form, the code that I have written is directly under this. Please tell me how to correct it, I am supposed to use checkboxes to purchase the number of tickets that I want and then all of the ticket information is supposed to appear on the other side.


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 Final
{
public partial class Form1 : Form
{


static int count1 = 0, count2 = 0, count3 = 0, car1Sale = 0, car2Sale = 0, car3Sale = 0;
public Form1()
{
InitializeComponent();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
chkPanel1();
textBox4.Text = Convert.ToString(count1 + count2 + count3);
saleCalulate();


}
private void checkBox14_CheckedChanged(object sender, EventArgs e)
{
chkPanel2();
textBox4.Text = Convert.ToString(count1 + count2 + count3);
saleCalulate();
}
private void button2_Click(object sender, EventArgs e)
{
foreach (Control cBox in this.panel1.Controls)
{
if (cBox is CheckBox)
{
((CheckBox)cBox).Checked = false;
}
}
foreach (Control cBox in this.panel2.Controls)
{
if (cBox is CheckBox)
{
((CheckBox)cBox).Checked = false;
}
}
foreach (Control cBox in this.panel3.Controls)
{
if (cBox is CheckBox)
{
((CheckBox)cBox).Checked = false;
}
}
clearAvailable();
}
private void chkPanel1()
{
clearAvailable();
count1 = 0;
foreach (Control c in this.panel1.Controls)
{
if (c is CheckBox)
{
if (((CheckBox)c).Checked)
{
count1++;
textBox1.Text = count1.ToString();
}
}
}
}
private void clearAvailable()
{
textBox10.Text = "";
textBox11.Text = "";
textBox12.Text = "";
textBox9.Text = "";
}
private void chkPanel2()
{
clearAvailable();
count2 = 0;
foreach (Control c in this.panel2.Controls)
{
if (c is CheckBox)
{
if (((CheckBox)c).Checked)
{
count2++;
textBox2.Text = count2.ToString();
}
}
}
}
private void chkPanel3()
{
clearAvailable();
count3 = 0;
foreach (Control c in this.panel3.Controls)
{
if (c is CheckBox)
{
if (((CheckBox)c).Checked)
{
count3++;
textBox3.Text = count3.ToString();
}
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
chkPanel1();
chkPanel2();
chkPanel3();
textBox4.Text = Convert.ToString(count1 + count2 + count3);
saleCalulate();
}


private void saleCalulate()
{
car1Sale = count1 * 300;
car2Sale = count2 * 200;
car3Sale = count3 * 100;
textBox5.Text = "$" + car1Sale;
textBox6.Text = "$" + car2Sale;
textBox7.Text = "$" + car3Sale;
textBox8.Text = "$" + Convert.ToString(car1Sale + car2Sale + car3Sale);
}
private void checkBox40_CheckedChanged(object sender, EventArgs e)
{
chkPanel3();
textBox4.Text = Convert.ToString(count1 + count2 + count3);
saleCalulate();
}
private void button1_Click(object sender, EventArgs e)
{
textBox9.Text = Convert.ToString(50 - (count1 + count2 + count3));
textBox10.Text = (10 - count1).ToString();
textBox11.Text = (20 - count2).ToString();
textBox12.Text = (20 - count3).ToString();
}
}
}


o! Form1<br>CAR #1<br>groupBox2<br>CAR #3<br>A<br>B<br>Purchase infomation<br>1<br>SEATS TO PURCHASE<br>CAR #1:<br>CAR #2:<br>4<br>CAR #3:<br>Total seats to purchase: o<br>CAR #2<br>SE<br>PRICE<br>groupBox3<br>CAR #1 A D<br>$300<br>SEAT SALES:<br>CAR #1:<br>CAR #2<br>$200<br>2<br>CAR #2:<br>CAR #3 A В СD $100<br>CAR #3:<br>Total Sales:<br>5<br>Purchase<br>Clear<br>Seat infomation:<br>SEATS AVAILABLE/TOTAL:<br>TOTAL SEATS:<br>/50<br>CAR #1:<br>/10<br>CAR #2:<br>/20<br>CAR #3:<br>/20<br>3.<br>LO<br>

Extracted text: o! Form1 CAR #1 groupBox2 CAR #3 A B Purchase infomation 1 SEATS TO PURCHASE CAR #1: CAR #2: 4 CAR #3: Total seats to purchase: o CAR #2 SE PRICE groupBox3 CAR #1 A D $300 SEAT SALES: CAR #1: CAR #2 $200 2 CAR #2: CAR #3 A В СD $100 CAR #3: Total Sales: 5 Purchase Clear Seat infomation: SEATS AVAILABLE/TOTAL: TOTAL SEATS: /50 CAR #1: /10 CAR #2: /20 CAR #3: /20 3. LO
Write a program that can be used by MG-Train to purchase tickets. The train has three cars. Car<br>#1 has 10 seats (rows: 1-5, columns: A and D), Car #2 has 20 seats (rows: 1- 5, columns: A, C,<br>and D), and Car #3 has 20 seats (rows: 1- 5, columns: A, B, C, and D). Each car has different seat<br>price (Car #1: $300, Car #2: $200, and Car #3: $100).<br>The program should display a screen that shows which seats are available and which are taken.<br>For example, the following screen shows a chart depicting each seat in the train. Seats that are<br>taken are represented by an M symbol, and seats that are available are represented by a O<br>symbol.<br>MG-Train SEAT MAP<br>Car 1<br>Purchase Information<br>Seats to Purchase<br>Car #1<br>3.<br>Car 12<br>Car 3<br>3<br>Total Seats to Purchase:<br>Car #2<br>Seat Sales<br>Car #1:<br>$300<br>2<br>Car 2<br>$400<br>3<br>Car 3:<br>$300<br>Total Sales: $1.000<br>Car 3<br>Purchase<br>Clear<br>AB<br>C D<br>Sents Information<br>Seats (Available / Total)<br>Total Seats: 24 / 50<br>SEAT PRICE<br>Car #1: 9/ 10<br>Car #2 18 / 20<br>Car #1<br>AD: S300<br>Car 3: 17 / 20<br>Car N2<br>ACD: S200<br>Car #3<br>ABCD:S100<br>O DOOD O<br>O O DO<br>OO D O D O<br>KOOO O<br>

Extracted text: Write a program that can be used by MG-Train to purchase tickets. The train has three cars. Car #1 has 10 seats (rows: 1-5, columns: A and D), Car #2 has 20 seats (rows: 1- 5, columns: A, C, and D), and Car #3 has 20 seats (rows: 1- 5, columns: A, B, C, and D). Each car has different seat price (Car #1: $300, Car #2: $200, and Car #3: $100). The program should display a screen that shows which seats are available and which are taken. For example, the following screen shows a chart depicting each seat in the train. Seats that are taken are represented by an M symbol, and seats that are available are represented by a O symbol. MG-Train SEAT MAP Car 1 Purchase Information Seats to Purchase Car #1 3. Car 12 Car 3 3 Total Seats to Purchase: Car #2 Seat Sales Car #1: $300 2 Car 2 $400 3 Car 3: $300 Total Sales: $1.000 Car 3 Purchase Clear AB C D Sents Information Seats (Available / Total) Total Seats: 24 / 50 SEAT PRICE Car #1: 9/ 10 Car #2 18 / 20 Car #1 AD: S300 Car 3: 17 / 20 Car N2 ACD: S200 Car #3 ABCD:S100 O DOOD O O O DO OO D O D O KOOO O
Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here